Organizing Files: Copying Files and Folders
Organizing Files: Copying Files and Folders
shutil.copytree(source, destination) will copy the folder at the path source, along with all of its files and
subfolders, to the folder at the path destination
import os
for filename in os.listdir():
if filename.endswith('.rxt'):
#os.unlink(filename)
print(filename)
>>> exampleZip.extract('spam.txt')
'C:\\spam.txt'
>>> exampleZip.extract('spam.txt', 'C:\\some\\new\\folders')
'C:\\some\\new\\folders\\spam.txt'
>>> exampleZip.close()