Python Forum

Full Version: help needed with python launcher
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello,
i need help with python launcher on the latest version when i try to run any script it just open the python terminal and close it immediately in just a second and doesn't run the script i tried to use any older python versions and it's the same problem and those scripts i'm wiling to run i ran it before on other computers with the same os i'm using right now and worked well but i don't know what i have to do to solve this issue
my os is windows 10 pro 64bit and python 3.7.2 64bit
(Jan-19-2019, 12:36 AM)fallenlight Wrote: [ -> ]i need help with python launcher on the latest version when i try to run any script it just open the python terminal and close it immediately
I guess you mean cmd window?
Save an run this.
print('hello world')
input('press <Enter> to exit')
I pretty much never run a Python script bye double-clicking on it.
Always for first open cmd or cmder as i use,then type python my_script.py.
Or editor VS Code from start,
sometime for fast testing PyScripter as this editor allow no saving i can just copy in code from eg this forum and push run button.
(Jan-19-2019, 02:01 AM)snippsat Wrote: [ -> ]
(Jan-19-2019, 12:36 AM)fallenlight Wrote: [ -> ]i need help with python launcher on the latest version when i try to run any script it just open the python terminal and close it immediately
I guess you mean cmd window?
Save an run this.
print('hello world')
input('press <Enter> to exit')
I pretty much never run a Python script bye double-clicking on it.
Always for first open cmd or cmder as i use,then type python my_script.py.
Or editor VS Code from start,
sometime for fast testing PyScripter as this editor allow no saving i can just copy in code from eg this forum and push run button.
i added print('hello world')
input('press <Enter> to exit')
to the scripts and the issue still exists
(Jan-19-2019, 11:23 AM)fallenlight Wrote: [ -> ]to the scripts and the issue still exists
How are running the script.
Bye double-clicking on it,or do you use an other method?

It's normal that File Associations is set to your main version in Windows Path.
From cmd:
C:\Windows>cd ..

C:\>python -V
Python 3.7.1

C:\>pip -V
pip 18.1 from c:\python37\lib\site-packages\pip (python 3.7)

C:\>python -c "import sys; print(sys.executable)"
C:\python37\python.exe
So File Associations for .py files for me set to point to Python 3.7.
This can be changed to what you want as show in link over.
For basic setup of Python in Windows:
Python 3.6/3.7 and pip installation under Windows