Functions: Reading, Writing Files Flashcards

1
Q

close

A

closes the file. Like File -> Save… in your editor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

read

A

reads the contents of the file. You can assign the result to a variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

readline

A

reads just one line of a text file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

truncate

A

Empties the file. Watch out if you care about the file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

wirte(‘stuff’)

A

writes “stuff” into the file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

seek(0)

A

Moves the read/write location to the begining of the file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly