
python
PaulYoung_Blog
这个作者很懒,什么都没留下…
展开
-
解决PyDev对新模块代码提示的问题【以cv2为例】
我用的IDE为eclipse安装了PyDev插件来进行开发。后来我在编译安装完opencv后,希望利用opencv-python来进行开发,但是PyDev却在代码提示里找不到cv2的模块及其函数。通过编译安装或pip安装的模块有且都会有这个问题,解决这个问题可以通过以下几个步骤。打开eclipse 选择Window–>Preferences–>PyDev–>Interpreters–>Python原创 2016-01-27 16:30:39 · 4401 阅读 · 0 评论 -
Python错误: SyntaxError: Non-ASCII character
1)问题描述在写Python代码的过程中,有用到需要输出中文的地方,但是运行后发现上述错误。SyntaxError: Non-ASCII character ‘\xe4’ in file ./common.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details错误转载 2016-02-05 14:13:26 · 1021 阅读 · 0 评论 -
Python ConfigParser的使用
1.基本的读取配置文件-read(filename) 直接读取ini文件内容 -sections() 得到所有的section,并以列表的形式返回 -options(section) 得到该section的所有option -items(section) 得到该section的所有键值对 -get(section,option) 得到section中option的值,返回为string类型转载 2016-02-05 14:30:09 · 9677 阅读 · 0 评论 -
处理错误TypeError: initial_value must be unicode or None, not str
StringIO在处理字符串时会报如下错误TypeError: initial_value must be unicode or None, not str这是因为python版本的问题,对应版本如下:python-dateutil-2.0.tar.gz (Python >= 3.0)python-dateutil-1.5.tar.gz (Python < 3.0)所以解决方法如下:#若使用的是p原创 2016-02-05 15:35:56 · 10138 阅读 · 1 评论 -
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
在linux中开发python时,会遇到该问题。该问题的含义是指,gcc未找到<Python.h>头文件,所以需要通过依赖安装来安装该支持库。python2.x:sudo apt-get install python-dev sudo apt-get install libevent-devpython3.x:sudo apt-get install python3-devsudo apt-ge原创 2016-08-11 13:02:24 · 11130 阅读 · 0 评论 -
apt-file 查找缺失文件所在包
apt-file是一款软件包查找工具,用来查找缺失的文件是在哪个依赖包中,可以通过该依赖包来进行安装。 譬如:fatal error: X11/extensions/XTest.h: No such file or directory这种错误,就可以通过apt-file来查找该头文件所在的库,并进行安装。$ sudo apt-get install apt-file$ sudo apt-file原创 2016-08-11 13:35:59 · 1968 阅读 · 0 评论