Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the Python version line mean?

What does the line that's displayed when you start an instance of the Python interpreter mean?

Python 2.7 (r27:82525, Jul  4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] on win32 

So I know I have Python 2.7, but what about the rest?

Especially confusing to me are the 64 bit (AMD64) on win32 and r27:82525 sections.

like image 688
Mark Avatar asked Jul 20 '13 01:07

Mark


People also ask

What is version in Python?

There are different versions of Python, but the two most popular ones are Python 2.7. x and Python 3.7. x. The x stands for the revision level and could change as new releases come out.

How do I tell which version of Python I have?

Open terminal: type “ terminal “, click on the terminal app. Execute command : type python ‐‐version or python -V and press Enter . The Python version appears in the next line right below your command.

What is the first line in a Python program?

#!/usr/bin/env python """ The first line in this file is the "shebang" line. When you execute a file from the shell, the shell tries to run the file using the command specified on the shebang line. The ! is called the "bang". The # is not called the "she", so sometimes the "shebang" line is also called the "hashbang".

How do I run a Python version from command line?

type python2 scriptname.py , or python3 scriptname.py in command line to switch the version you like.


2 Answers

That line you see indicates how the python interpreter was built. Breaking it down:

Python 2.7                        -- Python version (r27:82525, Jul 4 2010, 07:43:08) -- The build date and revision from src trunk                                       that was used to build this. [MSC v.1500 64 bit (AMD64)]       -- Compiled with MSVC compiler targeting 64-bit on win32                          -- Obviously for windows platform 
like image 114
greatwolf Avatar answered Oct 06 '22 00:10

greatwolf


r27: revision 27

82525: build 82525

Jul 4 2010, 07:43:08: when your python binary was built

MSC v.1500: compiled with 64w-bit VC++ 2008

win32: you are using windows

It has also been asked before.

like image 41
Brian Avatar answered Oct 06 '22 00:10

Brian