方法一
>>> from platform import python_version
>>> print python_version()
2.7.8
方法二
>>> import sys
>>> sys.version
'2.7.3 (default, Feb 27 2014, 19:58:35) \n[GCC 4.6.3]'
>>> sys.version_info
sys.version_info(major=2, minor=7, micro=3, releaselevel='final', serial=0)