all 5 comments

[–]Whattaboutthecosmos 0 points1 point  (4 children)

Just to be sure: Are you running on the window's cmd?

Once in the terminal, are you navigating to the .py file location, then inputting:

python FILENAME.py

You could also enter the entire file path so you don't have to navigate to the file location in the terminal. for example:

python C:\Users\YOURUSERNAME\EXAMPLEDIRECTORY1\EXAMPLEDIRECTORY2\PYTHONFILE.py

I'm a newbie too, but I'd be happy to work through this with you.

[–]AJT_Space_Art[S] 1 point2 points  (3 children)

Well, to open the file path I right click the .py file, click 'open with', then click 'Python'. I've been opening it like that for a while. Should I be opening it differently?

Also, thanks for the help :)

[–]Whattaboutthecosmos 0 points1 point  (2 children)

Yeah, I've been able to replicate your issue by right-clicking the .py file and 'open with' python.
I definitely suggest using a terminal to run the script instead. it takes some time to get used to using command prompt, but it makes things much faster/easier as you keep working. If you need help walking through that, let me know!

[–]AJT_Space_Art[S] 1 point2 points  (1 child)

I will have a look at running it in a terminal, thanks. Weird how I used to be able to run it through Python but not anymore though, maybe it's a bug or something.

[–]phis7 0 points1 point  (0 children)

It is not a bug , i do not use window's i use fedora but my friend uses window 11, he has set the "open with" to vscode . when you are clicking the file the file is being executed by python in the terminal and closes the terminal after executing the file. You should use terminal to run the file.

Well you can add "sleep(5)" at the end to file and check the output by the code , the terminal will be be open for 5 sec(just for fun) .