标准库os os.path shutil 提供文件复制、移动、重命名,查看文件属性,压缩/解压缩文件,以及文件夹的创建与删除等
import os
import os.path
os.rename(r'C:\test1.txt',r'C:\test2.txt')
os.getcwd() #返回当前工作目录
os.mkdir(os.getcwd() + '\\temp') #创建目录
os.chdir(os.getcwd() + '\\temp') #改变当前工作目录
标准库os os.path shutil 提供文件复制、移动、重命名,查看文件属性,压缩/解压缩文件,以及文件夹的创建与删除等
import os
import os.path
os.rename(r'C:\test1.txt',r'C:\test2.txt')
os.getcwd() #返回当前工作目录
os.mkdir(os.getcwd() + '\\temp') #创建目录
os.chdir(os.getcwd() + '\\temp') #改变当前工作目录