Background:
深度学习、数据科学里面处理数据时,需要对数据进行处理。比如 move
三种方法可行:
shutil.move()
os.rename()
os.system()
import os
import shutil
os.system("mv path/to/current/file.foo path/to/new/destination/for/file.foo")
os.rename("path/to/current/file.foo", "path/to/new/destination/for/file.foo")
shutil.move("path/to/current/file.foo", "path/to/new/destination/for/file.foo")
reference:
python中shutil文件操作模块的使用