![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
jimmy_游戏人生
热爱技术,为专研技术可以废寝忘食。
展开
-
python 解析 csv时报错
new-line character seen in unquoted field – do you need to open the file in universal-newline mode?网上普遍的做法是,传递file的时候通过open(fpath,'rU')来控制文件的分段原创 2013-10-30 18:10:02 · 1030 阅读 · 0 评论 -
python 时间操作
import timeprint time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())原创 2013-10-31 14:28:48 · 690 阅读 · 0 评论 -
pyinstaller 打包时出现No Module Named pkg_resources
由于在项目中包括了python-mysql 模块, 故在import mysql 的时候,也要 import pkg_resources重新用pyinstaller 打包,问题解析。原创 2015-08-11 09:35:30 · 3615 阅读 · 0 评论 -
关闭windows错误弹窗,这对python调用window命令非常有用
在windows注册表中,找到DontshowUI项,然后把它的值改成1就可以了。 如果是烂人的话,直接搜搜DontshowUI项会更快。原创 2014-12-09 14:27:42 · 2258 阅读 · 0 评论 -
使用python做webservice服务
import soaplibfrom soaplib.core.util.wsgi_wrapper import run_twisted #发布服务from soaplib.core.server import wsgifrom soaplib.core.service import DefinitionBase #所有服务类必须继承该类from soaplib.core.ser原创 2014-05-21 16:15:24 · 3748 阅读 · 1 评论 -
python 动态调用python 代码
import sysimport StringIO# create file-like string to capture outputcodeOut = StringIO.StringIO()codeErr = StringIO.StringIO()code = """def f(x): x = x + 1 return xprint 'This is my原创 2014-04-17 10:06:36 · 671 阅读 · 0 评论 -
python 编码出错问题
一般采用如下的解决方案reload(sys)sys.setdefaultencoding('utf-8')原创 2014-01-23 17:38:31 · 528 阅读 · 0 评论 -
python str.find使用的注意事项
最近在使用str.find方法时,常常用 if str.find(‘ab’) >0 ,这个判断是有问题的, 当ab不在str中时,返回-1, 当ab 在-1中时,返回a字母所在字符串中的位置。返回0,表式a在字符串的第一个位置原创 2014-01-15 14:36:33 · 1843 阅读 · 0 评论 -
python split使用总结
在python 中,有两种类型的split , 一种是str.split() 另外一种是os.path.split() 2. os.path.split() ,这个是分了分隔文件的路径 如,http://www.baidu.com/a/b/file.htmlimport os.pathif __name__=="__main__": url='http://www.baid原创 2014-01-14 16:29:13 · 886 阅读 · 0 评论 -
python 中的正则的使用技巧
使用python已经有一段时间了,它的正则的功能非常的强大。在用python的正则之前,我一直用的是grep的正则,grep的正则,它没有从已经匹配的串中提取特殊的字符串的功能。如: 搜索引擎,如果我们匹配了这个标签,我们要把href中的网址内容提取出来,egrep可能就无能为力了。原创 2013-12-02 13:32:11 · 1019 阅读 · 0 评论 -
scrapy 对应的图形UI 配置工具
scrapy 对应的图形配置工具 portia原创 2016-08-24 13:18:23 · 2535 阅读 · 0 评论