python
我只是个小QA
这个作者很懒,什么都没留下…
展开
-
解决python配置文件中中文路径问题
只需要把中文路径放入list列表即可正常读取使用line = f.readline() xls_file_path_list=[]print u'读取配置ing...' while line: line = f.readline() if "file_path" in line: line1=line.split('=') xls...原创 2018-08-15 16:46:14 · 1653 阅读 · 0 评论 -
python使用 py2exe打包命令
1.填set_up.py set_up.py内容:# mysetup.pyfrom distutils.core import setupimport py2exesetup(console=["需要打包的py文件名字.py"])2.打开命令行,执行 python set_up.py py2exe3.等待执行结束,在dist里面会出现跟setup(console=[“需要打...原创 2018-08-15 17:05:36 · 1923 阅读 · 0 评论 -
Python csv模块读csv文件,编码问题处理
Python csv模块读csv文件,编码问题处理import csvfile_rute:文件路径with open(file_rute,"r+") as csvfile: reader=csv.reader(csvfile) for i,rows in enumerate(reader): #i=行数 #rows=行的数据,为list #处理csv数据逻...原创 2018-10-17 20:51:02 · 1875 阅读 · 0 评论 -
python之openpyxl模块(与xlrd,xlwt不同,且不可混用)
为什么要研究openpyxl模块?做的批量替换表格内容工具发现python的一个坑.openpyxl和(xlrd,xlwt)不可混用!openpyxl和(xlrd,xlwt)不可混用!openpyxl和(xlrd,xlwt)不可混用!然而只能用openpyxl重写一个工具。来自网友的经验:#Python大坑:openpyxl和(xlrd,xlwt)不可混用!#工程名、包名、文件名、...原创 2019-09-06 15:24:00 · 3933 阅读 · 0 评论 -
python 脚本发送get/post请求(django服务器403处理方法)
1.get请求import urllib,urllib2url='http://192.168.14.227:8000/test/'data ={ 'user':'test', 'password':'123456' }data = urllib.urlencode(data)print(data)#输出内容:password=admin&user=adminre...原创 2019-09-25 11:31:04 · 1047 阅读 · 0 评论