搭建Python开发环境

2017-06-08  本文已影响17人  烫嘴豆腐
image.png image.png image.png image.png

/usr/bin/yum文件

#!/usr/bin/python2.6
import sys
try:
    import yum
except ImportError:
    print >> sys.stderr, """\nThere was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   %s

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
%s

If you cannot solve this problem yourself, please go to
the yum faq at:
  http://yum.baseurl.org/wiki/Faq

""" % (sys.exc_value, sys.version)
    sys.exit(1)

sys.path.insert(0, '/usr/share/yum-cli')
try:
    import yummain
    yummain.user_main(sys.argv[1:], exit_code=True)
except KeyboardInterrupt, e:
    print >> sys.stderr, "

Exiting on user cancel."
    sys.exit(1)
image.png image.png

腾讯云开发者实验室 https://www.qcloud.com/developer/labs

上一篇 下一篇

猜你喜欢

热点阅读