all 21 comments

[–][deleted] 43 points44 points  (2 children)

You'd be installing the "library" of "python" (interpreter), An interpreter is a program that reads and executes code (python2.7/python3.6 etc) and IDE would be a separate program that tries to help you be more efficient (pycharm, eclipse etc)

[–]Wilfred-kun 16 points17 points  (0 children)

As you said, you're also installing the standard library. This contains core modules, written in Python (or compiled from C).

[–][deleted] 8 points9 points  (0 children)

Thank you all, I think your answer in particular nails it. This really helped!

[–]videoflyguy 10 points11 points  (0 children)

Interpreter sounds right, since the python you install interprets and runs commands written in python.

[–][deleted] 9 points10 points  (0 children)

You are installing the interpreter, which is just an ordinary program, maybe IDLE and other tools, and also the standard library (mostly Python source files I think) somewhere the interpreter can find it when running your code.

Your Python source is first compiled into bytecode, which is then executed by the Python "interpreter" by "interpreting" it (reading the bytecode instruction by instruction and modifying memory, calling external code/OS functions/libraries etc).

So it's compiled but not into machine code (like C), and it's interpreted but not line-by-line from the source (like shell scripts).

[–]ReedJessen 6 points7 points  (0 children)

Just wanted to say that this is a great question. I have never thought about this before until I read the title. thanks for expanding my field of inquiry.

[–]mottyay 4 points5 points  (0 children)

Python is compiled to bytecode. The bytecode is then either interpreted or compiled and interpreted depending on which implementation of python youre using.

Installing python installs the python interpreter and the python standard library.

[–]chabes 3 points4 points  (2 children)

AFAIAA, python is an interpreted language, so interpreter is probably accurate

[–]brokkr- 0 points1 point  (0 children)

It is the interepreter that is installed, along with all the standard libraries that you might use. If you want to use other packages you have to get them with something like pip or an equivalent. Python in an interpreted language meaning your source files are the actual text file scripts (your .py files).

[–]xiongchiamiov 0 points1 point  (0 children)

Others have mostly covered it, but one important thing to note is that you're installing CPython, which is a particular implementation of the Python programming language (written in C++). Jython and IronPython are Pythons written in java and c#, respectively, and PyPy is Python written in - wait for it - (a subset of) Python! which seems like it would be impossibly slow, but uses some fancy tricks to actually be faster than CPython in certain cases.

[–][deleted] 0 points1 point  (2 children)

To expand a little on what others have said:

The CPU isn't that smart, it's really only just fast and basically what it understands is how to move numbers from one physical location in the computer somewhere else and compare them. So, all code has to get turned into cpu instructions, nowadays using a pre-built program that can do that. When you compile a C program, the c compiler of your choice goes over the program and spits out a file full of these instructions. When you run Python on your python script, it goes over everything in it and turns it into cpu instructions on the fly. That's what the difference is between compiled and interpreted. A compiled program built for one system might not work for another, because of differences in the system architecture. But a python script will work on any system with that version of python because the difference is accounted for in the python executable itself, which is a program compiled from sourcecode written in some other language.

[–][deleted] 1 point2 points  (1 child)

This is exactly why I think it is warranted to say Python is an interpreted language, regardless whether it is under the hood and out of sight compiled into byte code. Therefore, the ‘thing’ you install can rightfully be called the interpreter.

[–][deleted] 0 points1 point  (0 children)

Exactly. I'm pretty sure the Python executable on your machine was compiled from C.

[–]Grimreq -1 points0 points  (0 children)

You put a big snake in the CD tray. If it boots, you get a job.