
python
friendan
快乐源于分享丶
展开
-
PyQt4参考文档
事情是这样的,我在python中安装了PyQt4后,想查看QtGui模块中的类QMainWindow有哪些方法,如果查看呢?解决方法:1、原来在安装PyQt4时相应的帮助文档已经在安装目录里面了。2、打开 python安装目录\Lib\site-packages\PyQt4\doc\html\index.html3、打开index.html后点击超链接:PyQt4 Co原创 2016-04-06 22:12:10 · 9398 阅读 · 0 评论 -
PyQt4选择文件夹
from PyQt4 import QtCore, QtGuiimport osimport sys# 菜单文件保存目录 点击事件 @QtCore.pyqtSlot() def OnClickMenuSetFileSaveDir(self): # print ("OnClickmenuSetFileSaveDir") tm原创 2016-04-06 22:19:53 · 5744 阅读 · 0 评论 -
PyQt QString转成python stirng
参考文章:http://blog.youkuaiyun.com/yatusiter/article/details/8252039def QString2PyString(self, qStr): # # QString,如果内容是中文,则直接使用会有问题,要转换成 python string return unicode(qStr.toUtf8(), 'utf-8', 'ig原创 2016-04-07 19:04:44 · 6820 阅读 · 0 评论 -
python打印堆栈信息
import loggingimport tracebackdef testPrintStackInfo(self): try: 1 / 0 # 触发异常 except BaseException as e: msg = traceback.format_exc() # 方式1 pri原创 2016-04-08 13:16:56 · 33132 阅读 · 0 评论 -
pip install goose-extractor // SyntaxError: Missing parentheses in call to 'print'
今天在安装python的goose-extractor开发包时出现如下错误:D:\Program Files (x86)\Python35-32\Scripts>pip install goose-extractorCollecting goose-extractor Using cached goose-extractor-1.0.25.tar.gzCollecting Pil原创 2016-03-28 22:44:54 · 4321 阅读 · 1 评论 -
AttributeError: module 'html5lib.treebuilders' has no attribute '_base'
AttributeError: module 'html5lib.treebuilders' has no attribute '_base'出错的原因是我使用的Python版本是:Python36-32解决方法: 将python版本改为:Python35-32原创 2016-09-05 11:58:13 · 2994 阅读 · 0 评论 -
'ascii' codec can't encode characters in position 0-4: ordinal not in range(128)
参考文章:http://bbs.youkuaiyun.com/topics/391492220安装好django suit后,运行服务器:python manage.py runserver在表单页面输入中文,保存时,出现如下错误:UnicodeEncodeError at /admin/ModelApp/server/1/change/'ascii' codec can't en原创 2017-09-15 14:45:26 · 16351 阅读 · 0 评论 -
File "_mssql.pxd", line 10, in init pymssql (pymssql.c:12429)
参考文章:https://github.com/pymssql/pymssql/issues/396https://github.com/pymssql/pymssql/issues/400https://github.com/pymssql/pymssql/issues/399https://stackoverflow.com/questions/36352728/importe原创 2018-01-07 14:29:44 · 1230 阅读 · 0 评论 -
python unicode-escape
unicode-escape编码集,他是将unicode内存编码值直接存储#python3>>> s ='中国'>>> b = s.encode('unicode-escape')>>> bb'\\u4e2d\\u56fd'>>> c = b.decode('unicode-escape')>...转载 2019-04-18 15:29:16 · 6530 阅读 · 0 评论