如何查看python的当前版本号

举报| 2015-01-12 14:30沙愒 | 浏览 8882 次
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
>>> help()
 
Welcome to Python 2.7!  This is the online help utility.
 
If this is your first time using Python, you should definitely check out
the tutorial on the Internet at 
 
 
Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type "quit".
 
To get a list of available modules, keywords, or topics, type "modules",
"keywords"or "topics".  Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as "spam"type "modules spam".
 
help>

 或者打开python shell:

1
2
3
4
ActivePython 2.7.2.5 (ActiveState Software Inc.) based on
Python 2.7.2 (default, Jun 24 201112:21:10) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright""credits" or "license()" for more information.
>>>

或者cmd:

Microsoft Windows [版本 6.1.7601]

版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

 

1
2
3
4
5
C:\Users\zhipeng>python
ActivePython 2.7.2.5 (ActiveState Software Inc.) based on
Python 2.7.2 (default, Jun 24 201112:21:10) [MSC v.1500 32 bit (Intel)] on win32
Type "help""copyright""credits" or "license" for more information.
>>>
1
2
C:\Users\zhipeng>python --version
Python 2.7.2

-----------------------

Linux

-----------------------

1
2
3
4
5
zhangzhipeng@Earth:~$ python
Python 2.6.6 (r266:84292, Nov 22 201312:16:22)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help""copyright""credits" or "license" for more information.
>>>

 

1
2
zhangzhipeng@Earth:~$ python --version
Python 2.6.6