摘要:
#!/usr/bin/python# -*- coding:utf-8 -*- import os import shutil os.remove(path) #删除文件shutil.rmtree(path) #删除文件夹及其子 可为'./dir' 也可'dir' 阅读全文
posted @ 2019-10-15 17:35
流星曳尾
阅读(1306)
评论(0)
推荐(0)
摘要:
#!/usr/bin/python# -*- coding:utf-8 -*- import os fileName1 = 'a.txt'if os.path.exists(fileName1): file1 = open(fileName1,'w') file1.write('file1 exis 阅读全文
posted @ 2019-10-15 16:37
流星曳尾
阅读(205)
评论(0)
推荐(0)
摘要:
#!/usr/bin/python# -*- coding:utf-8 -*- #!/usr/bin/python# -*- coding:utf-8 -*- file1 = open('a.txt','r')str = file1.read()file2 = open('b.txt','w')fi 阅读全文
posted @ 2019-10-15 15:58
流星曳尾
阅读(90)
评论(0)
推荐(0)
摘要:
#!/usr/bin/python# -*- coding:utf-8 -*- open('a.txt','w+') 阅读全文
posted @ 2019-10-15 15:54
流星曳尾
阅读(166)
评论(0)
推荐(0)
摘要:
#!/usr/bin/python# -*- coding:utf-8 -*- import os dir = './dir'os.mkdir(dir) 阅读全文
posted @ 2019-10-15 15:24
流星曳尾
阅读(138)
评论(0)
推荐(0)