f = open('data.txt'); f.read()
f = open('data.txt','r'); f.read(n)
myfile = open('data.txt'); f.readline()
f= open('data.txt'); f.readlines()
r
w
+
b
f = open("data.txt", "a")
f = Open("data.txt", "ab")
f= new("data.txt", "a")
open("data.txt", "a")
f.seek(-10, 0)
f.seek(10,0)
f.seek(-10, 1)
None of the above
end
beginning
anywhere in between the file
End of File
End of Line
End of Statement
End of program
open_file()
file_open()
open()
read_file()
close_file()
file_close()
close()
end_file()
Read mode
Write mode
Append mode
Binary mode
read()
readline()
readlines()
load()
write()
append()
add()
insert()
file_exists()
exists_file()
os.path.exists()
check_file()
Use multiple write() statements.
Use writelines() method.
Use writeLine() method.
Use append() method.
os
fileutils
filesystem
io
Comma Space Value
Comma Separated Value
Common spaced Value
Compact Structure View
End of List
End of Loop
End of Language
f.read(5)
f.read()=5
f.readline(5)
f.readlines(5)
Tells you the current position within the file.
Tells the size of file you read
Tells the start position of the file.
Tells the end position of the file.
csv.reader(file)
csv.read(file)
csv.readcsv(file)
csv.readcsvdata(file)
Read two words from file
Read two line from file
Read two character / two bytes
count the number of '2' in file