1.如何在Windows7上下载Python2.7?
1、说明:win7安装python2.7非常简单,只要到官方网站下载然后直接安装即可。
2、步骤:1)打开python官方网站windows版下载地址
4.python2.7怎么安装zbar
为了virtualenv里的python能用,编译时候要指定安装到/usr。
编译文件不多,一下就完了。步骤如下:
./configure –disable-video –without-qt –without-gtk –without-x –prefix=/usr
make
sudo make install
应该还需要安装ImageMagick,libjpeg-devel,zlib-devel之类的库,python环境里需要安装zbar和PIL。
上测试代码:
import zbar
from PIL import Image
scanner = zbar.ImageScanner()
scanner.parse_config('enable')
img = Image.open('./test.jpg').convert('L')
w, h = img.size
zimg = zbar.Image(w, h, 'Y800', img.tobytes())
scanner.scan(zimg)
for s in zimg:
print s.type, s.data
5.哪个版本更稳定
用python2.5、2.6和2.7其实是为了推广3.1.2,从python2.x到python3.1.2的过渡产物,部分语法同时向上下兼容。目前大部分代码都是2.5的,所以建议用2.7。
2.7 的稳定性肯定比3.1.2的要好,3.1.2功能比较新,但是不稳定,网上一起交流的朋友,经常出现安装错误,无法运行等错误。
而Python 2.7 是第一个正式版本。这也是 Python 计划中 2.x 的最后的主要版本。
该版本包含很多 Python 3.1 中的新特性,主要的提升包括如下几个方面:
An ordered dictionary type
New unittest features including test skipping and new assert methods
A much faster io module
Automatic numbering of fields in the str.format() method
Float repr improvements backported from 3.x
Tile support for Tkinter
A backport of the memoryview object from 3.x
Set literals
Set and dictionary comprehensions
Dictionary views
New syntax for nested with statements
The sysconfig module
基于以上,我建议楼主用2.7。