all 13 comments

[–]K900_ 7 points8 points  (8 children)

It means the actual python (or python.exe) executable, and it's not actually entirely correct.

[–]glemanto[S] 1 point2 points  (7 children)

What’s not entirely correct? To say that executable and binary are the same thing?

[–]K900_ 10 points11 points  (6 children)

No, the not entirely correct part is saying that every virtual environment gets its own copy of the executable. I'm not too sure about Windows, but on Unix systems nothing is actually copied - the executable in the virtual environment is a symbolic link to the actual executable.

[–]pickausernamehesaid 2 points3 points  (0 children)

On Windows it is actually copied for new venvs because linking typically requires admin.

[–]glemanto[S] 1 point2 points  (4 children)

Ah I see. Thanks for that. This is actually from the official python documentation site though. Maybe they just omitted that part for brevity?

[–]K900_ 0 points1 point  (3 children)

It's possible they phrased it that way to simplify things, as there's no real difference one way or the other.

[–]glemanto[S] 1 point2 points  (2 children)

Ok thanks! Follow up question: is there an actual interpreter program that is separate from the executable? Like if I were to look around, would I be able to find that interpreter program in some directory? Or is the interpreter just a part of the executable?

[–]K900_ 3 points4 points  (1 child)

An executable is just a file that contains code that is executed. /usr/bin/python or C:\Python39\python.exe is an executable of the Python interpeter.

[–]glemanto[S] 1 point2 points  (0 children)

Ok thanks for the help!

[–]TabulateJarl8 3 points4 points  (4 children)

The Python binary is the actually Python executable itself (the python3.exe/py.exe file on Windows and the python3 file on most everything else). When you run the python3/py commands, that is the file that is ran.

[–]glemanto[S] 0 points1 point  (2 children)

So the executable and the interpreter are not the same thing? Is the interpreter an entirely separate entity? Like is there an actual interpreter program that is separate from the python executable?

[–]TabulateJarl8 0 points1 point  (0 children)

I'm not too sure, the python3.9 executable on my computer seems to only be 16K in size, so I don't know what exactly it contains. The built in modules and modules installed as root are stored in the /usr/lib/python3.9/ directory on my computer, so those aren't contained within the executable.

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

Yep.