CentOS安装pypy

1、下载地址:

http://pkgs.org/search/?keyword=pypy

2、安装顺序:

0> rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/pypy-libs-2.0.2-1.el6.x86_64.rpm

0> rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/pypy-2.0.2-1.el6.x86_64.rpm

0> rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/pypy-devel-2.0.2-1.el6.x86_64.rpm

3、测试脚本

#script_name: test_pypy.py
#!/usr/bin/env python
def check(num):
     a = list(str(num))
     b = a[::-1]
     if a == b:
         return True
     return False
 
 
def main():
    all = xrange(1,10**7)
    for i in all:
        if check(i):
            if check(i**2):
                print i,i**2
 
 
if __name__ == '__main__':
    main()

4、测试:

0>  time pypy test_pypy.py
0>  time python test_pypy.py


你可能感兴趣的:(CentOS安装pypy)