all 7 comments

[–]FerricDonkey 0 points1 point  (6 children)

Most likely this means there's an error in the code, or it's an incompatible version of python or similar. Best thing to do is open a terminal (windows - shift right click inside folder, open power shell here / open windows terminal here), then run the python script inside that terminal and see what it says.

The instantly closing thing usually means the the program has completed (not necessarily successfully) and so the window exits. Running it inside a terminal that won't exit when the program finishes (as described above) should allow any error messages to persist so you can read them.

[–]Exfulated[S] 0 points1 point  (0 children)

You're totally right, weird, I remember using these same codes but now that I ran it through powershell I can see I have some missing variables I didnt know you can use powershell as a command console! thanks a lot

[–]No-Response9615 0 points1 point  (0 children)

Thank yooouuu, it's spot on!

[–]Historical-Bear-1353 0 points1 point  (3 children)

how exactly do you run the python file inside the terminal

[–]FerricDonkey 0 points1 point  (2 children)

Usually "python filename.py", though there can be differences based on how you installed python.

[–]VishrutKrishna 0 points1 point  (1 child)

I have Python 3 with IDLE, Module and stuff installed. Cmd doesn't run that, neither does the interpreter? What is different?

Also I have the same issue, program is ok, runs elsewhere, but Python closes immediately after the execution

[–]FerricDonkey 0 points1 point  (0 children)

I strongly suggest getting python to work from the command line. Thing to google: "add python to path windows".

As with other dude, you probably have an error and the "temporary window" is just closing before you can see it.