import os print(os.getcwd()) os.chdir(r'C:\Users\Administrator\PycharmProjects') print(os.getcwd()) os.chdir('..') print(os.getcwd()) os.makedirs('dirname1/dirname2') os.removedirs('dirname1/dirname2') os.mkdir('dirname1/dirname') print(os.listdir(r'C:/Users/Administrator/PycharmProjects/s9')) print(os.stat('1.复习.py')) print(os.sep) # python代码跨平台 :linux windows os.system("dir") ret = os.popen("dir").read() print(ret) print(os.environ) print(os.getcwd()) print(os.path.split(os.getcwd())) print(os.path.join(r'C:\Users\Administrator','user','local')) print(os.getcwd()) print(os.path.getsize(os.path.join(os.getcwd(),'1.复习.py')))