2017年2月6日

摘要: 正确方法为:open("test1.txt",'wb')或open("test1.txt",'w') 以下是网上的方法创建遇到的问题 使用Python2.7在windows系统中os.mknod调用错误 一直想学习一门脚本语言,用来做一些快速的脚本处理。在同事的强烈推荐下,我选择了Python。最开 阅读全文
posted @ 2017-02-06 17:44 sunny_2016 阅读(1637) 评论(1) 推荐(0)
摘要: #批量创建txt文件import sys,osa=open("demo.txt")n=0aList=[]for line in a.readlines(): aList.append(str(line.strip('\n')))print aListfor i in aList: os.system 阅读全文
posted @ 2017-02-06 17:33 sunny_2016 阅读(1449) 评论(0) 推荐(0)
摘要: #coding=utf-8import sys, string, os, shutil #输入目录名和前缀名,重命名后的名称结构类似prefix_0001 def RenameFiles(srcdir, prefix): srcfiles = os.listdir(srcdir) index = 1 阅读全文
posted @ 2017-02-06 17:19 sunny_2016 阅读(2736) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2017-02-06 14:52 sunny_2016 阅读(4) 评论(0) 推荐(0)
摘要: C:\Users\ceshi>pythonPython 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit (AMD64)] on win32Type "help", "copyright", "credit 阅读全文
posted @ 2017-02-06 13:19 sunny_2016 阅读(179) 评论(0) 推荐(0)

导航