import os import sys path = sys.argv[1] file = sys.argv[2] if not os.path.exists(path): os.makedirs(path) print("目录创建成功") else: print("该目录已经存在") os.chdir(path) print(os.getcwd()) newfile = open(file, 'w') print(os.listdir())