Python Forum
.py File extension now working
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
.py File extension now working
#1
https://gyazo.com/70f90b2a0502b36f62e44392b3c7efb4
When I try to run a .py file, I get this error message. Can anyone please help? Thanks in advance.
Reply
#2
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.
Reply
#3
Thanks for the reply! I am running Windows 8.1 Here's the screenshot again. https://imgur.com/a/IYkVB
Reply
#4
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
Reply
#5
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?
Reply
#6
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question apk file not working on android polya001 0 1,158 Feb-06-2022, 11:58 PM
Last Post: polya001
  Subprocess.Popen() not working when reading file path from csv file herwin 13 15,116 May-07-2021, 03:26 PM
Last Post: herwin
  find file not knowing the extension Leon79 6 3,116 Jul-07-2020, 04:44 PM
Last Post: Leon79
  Can't open/read txt file in C extension for Python Rad226 8 4,819 Jun-26-2020, 04:08 PM
Last Post: Rad226
  Python File to EXE Not working. MianDoesCoding 9 6,836 Jun-09-2020, 08:21 AM
Last Post: MianDoesCoding
  How to get file name without the full path details and without extension aruncom2006 1 5,934 Jan-13-2020, 07:37 AM
Last Post: Larz60+
  How to fetch file from a list which match file extension suddhasilsarkar 1 2,822 Jul-30-2019, 11:54 AM
Last Post: Malt
  Working with LibreOffice file FASB 0 1,996 Jun-13-2019, 01:23 PM
Last Post: FASB
  Filter out file extension Kiwi_man82 9 9,557 Jan-08-2017, 09:34 PM
Last Post: Kiwi_man82
  Unable to open files without file extension pstarrett 3 7,272 Dec-25-2016, 09:15 AM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020