'sys' module Flashcards

1
Q

sys.argv

A

provides access to argument vector -> script input from command line

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

sys.argv.remove(sys.argv[x])

A

removes argument from sys.argv

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

var = input(x)

A

captures user input

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

file = open(x, y)

A

Open a file. takes two arguments, file name and mode (w, r, r+, a)

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

file_name.name

A

return name of the file

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

file_name.mode

A

return mode of the file

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

file_name.write(x)

A

write to file

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

file_name.close()

A

close file

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

file_name.read()

A

read the file

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

file_name.seek(x)

A

reset file’s seek pointer

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