I want to know how to copy the file. I thought it would be in the os module, so I looked it up, but it's not here ㅜ<
python filesystems
shutilUse the module
I'll tell you 2 ways.
src = '/dir1/filename'
dst = '/dir2'
copyfile(src, dst)
copyfile() is
import shutil
shutil.copy2('/dir/file.ext', '/new/dir/newname.ext')
#or
shutil.copy2('/dir/file.ext', '/new/dir')
© 2024 OneMinuteCode. All rights reserved.