
python那点事
slx_2011
这个作者很懒,什么都没留下…
展开
-
python获取shell返回值
在python中调用shell,为了实现流程控制,需要捕获shell的返回值as咱们都知道,shell正常执行的返回为0,失败或异常为非0,在python中可以通过,如下方式获取到执行的返回状态码>>> import commands>>> commands.getstatusoutput('ls /bin/ls')(0, '原创 2014-03-18 11:51:18 · 6758 阅读 · 0 评论 -
Python升级2.4到2.7
Python升级 # yum install gcc gcc-c++.x86_64 compat-gcc-34-c++.x86_64 openssl-devel.x86_64 zlib*.x86_64 # wget http://www.python.org/ftp/python/2.7/Python-2.7.tar.bz2 # tar -xvjf Python-2.7.tar.bz2原创 2017-02-07 13:37:07 · 1311 阅读 · 0 评论