What do you want to save?
Add Code snippet
New code examples
-
Other 2021-10-13 16:41:12
convert cys file into txt flutter
Future<List<String>> getFileLines() async { final data = await rootBundle.load('assets/bot.txt'); final directory = (await getTemporaryDirectory()).path; final file = await writeToFile(data, '$directory/bot.txt'); return await file.rea... Add solution -
Python 2021-10-12 16:28:08
python 3 text file leng
f = open("filename", "r") #Load file in any mode that's able to read, ie r, r+, w+ etc #to get length len(f.readlines()) #To iterate over each line for line in f.readlines(): #file.readlines(), splits the file into a list, where each... Add solution -
Python 2021-10-10 03:37:03
python with file.open
# Reference https://docs.python.org/3/library/functions.html#open # Method 1 file = open("welcome.txt", "r") # mode can be r(read) w(write) and others data = file.read() file.close() # Method 2 - automatic close with open("welc... Add solution -
Python 2021-10-10 00:11:08
how to check for a particular word in a text file using python
file = open("search.txt") print(file.read()) search_word = input("enter a word you want to search in file: ") if(search_word in file.read()): print("word found") else: print("word not foun... Add solution -
Python 2021-10-06 04:44:09
random number without random module
# First let's make a function that makes a random number def randint(a, b): "Return random integer in range [a, b], including both end points." return a + randbelow(b - a + 1) def randbelow(n): "Return a random int in the ran... Add solution -
Python 2021-10-05 15:57:05
with statement in python
In python if you want to operate some file then you have to use some specific function for that after using that we can read or manipulates the data of the file. And for operating the file we use open() function. open returns the file object, from which w... Add solution -
C++ 2021-10-05 12:07:05
write and read string binary file c++
#include <cstring> #include <iostream> #include <fstream> #include <string> struct player_data { std::string name; int score; }; int main() { std::ofstream savefile("score.dat", std::ios_base::binary); if(savef... Add solution
Best helpers
Ranking is empty