On Linux, you will need to make the .py executable
chmod 750 mypyprog.py
add the correct shebang to the first line to make the shell or file explorer know the correct interpreter
#!/usr/bin/python3 print('Meow :3')
If you want to view the results before closing the shell window, it is useful to use the staller at the end (as shown in MackM):
input('Press any key...')
As we can see from the comments, you have already mastered steps 1 and 2, so 3 will be your friend.
Windows does not know about shebangs. You will need to associate the .py extension with the Python interpreter, as described in the documentation . For this, the python interpreter should not be in PATH , because the full path can be specified here.
source share