Python Forum
Python App On Different Versions - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: Python App On Different Versions (/thread-29267.html)



Python App On Different Versions - Harshil - Aug-25-2020

How To know if my python app can run on different versions of python 3.x And 2.7 also!


RE: Python App On Different Versions - buran - Aug-25-2020

(Aug-25-2020, 01:46 PM)Harshil Wrote: How To know if my python app can run on different versions of python 3.x And 2.7 also!
well, you should know how you have written it (what minimum target version you had in mind). of course you should know also the differences in different python versions. At the moment it no longer makes sense to target python2 at all


RE: Python App On Different Versions - Larz60+ - Aug-25-2020

In addition to buran's recommendation,

if you install pyenv (see: https://python-forum.io/Thread-pyenv-Simple-Python-Version-Management?highlight=pyenv )
you can easily switch python versions and then try running under each

and again, stay away from python 2.7 it's extinct


RE: Python App On Different Versions - snippsat - Aug-25-2020

If on Windows look here.
There is part about py there,which is used to run other versions.
C:\1
λ python -V
Python 3.8.3

C:\1
λ python hello.py
Hello from 3.8.3

# Run 2.7
C:\1
λ py -2.7 hello.py
Hello from 2.7.9

# Install to 2.7
λ py -2.7 -m pip install logzero
Requirement already satisfied: colorama; sys_platform == "win32" in c:\python27\lib\site-packages (from logzero) (0.3.2)
So python and pip always point to then main version eg 3.8,and py can access all other version from python.org.