摘要:
OS模块: os.getcwd()获取当前路径os.chdir()改变目录os.curdir返回当前目录os.pardir()父目录os.makedirs('a/b/c')创建多层目录os.removedirs()删除多层目录中的空目录os.mkdir()创建目录os.listdir()列出文件夹下 阅读全文
摘要:
1、持续输入数据、输完之后退出 with open('test4.txt','w',encoding='utf-8') as f: while True: inp = input("请输入内容:") if inp == 'q': break f.write(inp + '\n') with open 阅读全文