File object methods Flashcards
1
Q
read
A
Reads the contents of the file
2
Q
readline
A
Reads just one line of a text file
3
Q
write(‘stuff’)
A
Writes “stuff” to the file
4
Q
truncate
A
Empties the file. Watch out!
5
Q
seek(0)
A
Moves the read/write location to the beginning of the file
6
Q
close
A
Closes the file