Under Linux, you will have to make the .py
file executable
chmod 750 mypyprog.py
add the proper shebang in the first line to make the shell or file explorer know the right interpreter
#!/usr/bin/env python3
print('Meow :3') # <- replace this by payload
If you want to review the results before the shell window is closing, a staller at the end (as shown by MackM) is useful:
input('Press any key...')
As we see from the comments, you already mastered steps 1 and 2, so 3 will be your friend.
Windows does not know about shebangs. You will have to associate the .py
extension with the Python interpreter as described in the documentation. The python interpreter does not have to be in the PATH
for this because the full path can be specified there.