(Nov-28-2022, 10:09 AM)jerryf Wrote: Thanks again snippsat. So to confirm my understanding-when using cmd mode python does not appear to make any reference or use of Path and PYTHONPATH environment variables in searching for the script file, and so a full pathname must always be given unless starting from the directory containing the script file. Is that correct?Yes.
Never do this.
C:\Users\jerry>hello_world.pyNow is the reliance on that
file associations
is correct and this can suddently change.Use
python
,the you know that it will use Python 3.11.C:\Users\jerry>python hello_world.pyAlso when you later when need to configure editor/IDE you point to
python.exe
and what file associations is set to dosn't matter.# A test to make sure with full path to python.exe C:\Users>python -c "import sys; print(sys.executable)" C:\python310\python.exeYou could also look into
py
,can by used to run any python version.See that i have python 3.11,but still have python in OS Path that point to 3.10
# <py> will find newest one and don't care about what is OS path G:\div_code 位 py -V Python 3.11.0 G:\div_code 位 python -V Python 3.10.5I have some versions as you see馃憖
G:\div_code 位 py --list -V:3.11 * Python 3.11 (64-bit) -V:3.10 Python 3.10 (64-bit) -V:3.9 Python 3.9 (64-bit) -V:3.8 Python 3.8 (64-bit) -V:3.7-32 Python 3.7 (32-bit) -V:3.6-32 Python 3.6 (32-bit) -V:3.5-32 -V:3.4 -V:2.7 -V:2.1 -V:ContinuumAnalytics/Anaconda39-64 Anaconda py39_4.9.2 -V:ContinuumAnalytics/Anaconda37-64 Anaconda 4.7.12 -V:ContinuumAnalytics/Anaconda36-32 Anaconda 4.3.14