Python Forum

Full Version: .py File extension now working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
https://gyazo.com/70f90b2a0502b36f62e44392b3c7efb4
When I try to run a .py file, I get this error message. Can anyone please help? Thanks in advance.
You need to post your screenshot again, but in any case tell the forum what operating system you use,
just in case its platform specific.
Thanks for the reply! I am running Windows 8.1 Here's the screenshot again. https://imgur.com/a/IYkVB
I see your problem now.
On windows you need to associate the extention .py with the python interpreter.
This is the standard doc for python3:

https://docs.python.org/3.3/using/windows.html


See section 3.4.1 you need to ensure the launcher is on your path,
from windows command prompt type:
py

This should report the version of python you use.
To run your script it will be
py script.py
Thank you. I am having trouble understanding what to do to fix this - when I type "py" into the run box, it launches a cmd type thing. What should I do from here?
Sounds like you're seeing the interactive interpreter.  You can use that to test things out.
https://docs.python.org/3/tutorial/inter...ctive-mode