Commands Flashcards

1
Q

Remove a file

A

os.remove(‘file.txt’)

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

Copy a file

A

shutil.copy(‘sourcefile.txt’, ‘newfile.txt’)

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

Move a file

A

shutil.move(‘oldfile.txt’, ‘newfile.txt’)

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

Copy a directory

A

shutil.copytree(‘olddir’, ‘newdir’)

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

Remove a directory

A

shutil.rmtree(‘dir’)

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