#π why cant i open python files
24 messages Β· Page 1 of 1 (latest)
@restive iron
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
why cant i open this file without it closing for no reason?
That happens if you double click the python file. You should instead run it via command line, so that you can see the output. To do this, open file explorer to where the file is. Type cmd in the file path bar and press enter to open the cmd at that location. Run py file_name.py to run the file.
whats the file path bar
Not at my computer right now so I have to make due with stock images, number 4 in this image.
same on windows 11?
Yes
so put cmd there
Yes
am i dumb
Delete the downloads, it should just be cmd
Now type py "file name.py" and press enter. You need quotes since the file name has spaces.
You typed py file_name.py inside the file at some point, you need to delete that. Itβs probably at the very end.
Run pip install pywin32 to install win32api, then try again.
Run it in the command prompt?
Yep
Kk I'm gonna have to try it a bit later thanks for the help
π
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.