Python Functions Flashcards
1
Q
close( )
A
closes the file. Like File>Save in your editor
2
Q
read( )
A
reads the contents of the file. You can assign the result to a variable
3
Q
readline( )
A
reads just one line of a text file
4
Q
truncate( )
A
empties the file. Watch out if you care about the file
5
Q
write(‘stuff’)
A
writes ‘stuff’ to the file
6
Q
seek(0)
A
move the read/write location to the beginning of the file