|
|
Subscribe / Log in / New account

Linux distributions and Python 2

Linux distributions and Python 2

Posted Jun 12, 2018 5:58 UTC (Tue) by k8to (guest, #15413)
In reply to: Linux distributions and Python 2 by Kamilion
Parent article: Linux distributions and Python 2

How does it determine what is appropriate?


to post comments

Linux distributions and Python 2

Posted Jun 12, 2018 14:53 UTC (Tue) by rbanffy (guest, #103898) [Link] (1 responses)

If the script is already compiled to a .pyc, you can probably find out which version of Python compiled it (I never tried that because, frankly, I'm very happy with having python and python3 on /usr/bin).

Linux distributions and Python 2

Posted Jun 12, 2018 15:24 UTC (Tue) by k8to (guest, #15413) [Link]

That's determining which python already ran it, not which python it needs.
I don't believe it's very decidable.

Linux distributions and Python 2

Posted Jun 14, 2018 5:19 UTC (Thu) by kenshoen (guest, #121595) [Link] (1 responses)

They look at shebang line. #!python2 to 2, #!python3 to 3, #!python defaults to 2 (configurable).
https://docs.python.org/3/using/windows.html#customizing-...

Linux distributions and Python 2

Posted Jun 15, 2018 6:47 UTC (Fri) by nirbheek (subscriber, #54111) [Link]

So the same as Linux then?

py.exe on Windows solves a completely different issue: where is Python installed and how do I invoke it? All pythons (2, 3.4, 3.5, etc) are called python.exe, so putting it in PATH is not an option.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds