#๐ So when I want to run a Python file, it closes automatically, not even typing () helps
46 messages ยท Page 1 of 1 (latest)
@patent kite
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.
How are you running it?
Command or double clicking or by clicking a Play button?
can you share the code? and how you are running it
double click
don't do that open a terminal and type python filename.py
double clicks makes a temp terminal which closes the secound program ends leading you to not be able to see the output
open powershell
ok
go to this dir in powershell
and type python filename.py
in this case python macro.py
its says cant open file
What did your run? Double check the path.
how
ofc the terminal dont know where to find it
you can just copy the file and paste it
or drag to the terminal
you should tell where to find the file
@patent kite
$ python /to/the/file.py
what do you mean...
show the code
that didn't work too
uhhh you are not running the script...
can you show the code
do this
@patent kite
go to your python file click on properties and copy its path
then do python {path}\macro.py
paste path instead of {path}
type py first, then give it a space, then drag and drop the macro.py file to the terminal
You don't know how grateful I am, thank you guys again, it's working now.
you can still run it by double clicking but you have to add a promt telling "press Enter to close"
on the end
if your problem is solved pls type !close to close the post
!close
This help channel has been closed. 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.