Python shuts down when I try to run a module
torriem at gmail.com
Mon Jul 23 18:45:21 EDT 2018
On 07/23/2018 01:00 AM, Lyra wrote:
> I’ve just started to learn Python coding, and downloaded version 3.7.0 from the website. I’ve written 5 or 6 small programs and saved them, but whenever I try to run them, Python doesn’t work right. The user answers the first question and presses ENTER, but then the Python window just closes, disappears, and shuts down. My programs are all written correctly, and work just like they’re supposed to, when I run them in the Shell window instead. There are no error messages.
> I went into the original installation file of Python and clicked on “Repair”. There was a progress bar, and it said “Repair completed”, but the problem still occurs.
> I don’t want to uninstall the whole thing and download a different version until after I hear from someone here who knows more about it than I do.
This is expected behavior on Windows. Unless your program has a
graphical user interface that you've created, the proper way to run an
*interactive* python program is from the command prompt. Alternatively
you can run it from within IDLE or some other Python IDE like PyCharm.
So you're not doing anything wrong. Just don't run them by double
clicking; run them from a command prompt instead.
More information about the Python-list