import os import time script_name1 = os.path.abspath(__file__) path = os.path.split(script_name1)[0] print(path) b = path.split('\\') c = b[0] + '/' + b[1] + '/' + b[2] + '/' + 'Desktop/' print(c) try: os.mkdir(c+'导入11') os.mkdir(c+'导出11') f = open(c+'/'+'11111111.txt',mode='w',encoding='utf-8') e = 'ok' except Exception as e: print(e) f.write('abc') a = input('请输入任意字符退出')