Python doesn't work

Alan Gauld alan.gauld at yahoo.co.uk
Sun May 30 16:31:02 EDT 2021


On 30/05/2021 12:23, Mr.Incognito wrote:
>    Hello
> 
>    I downloaded the latest versioon of Python and tried to open several .py
>    files, but it doesn't open. It opens for a sec, then closes itself. I
>    tried uninstalling and reinstalling, but it doesn't work.

Most likely it is working but faster than you can see.
Python is a program interpreter so if you simply execute
a .py file, the interpreter will execute it and terminate.
Any output will be displayed in a terminal window which
will close when the interpreter finishes.

The way round that is to launch the programs from inside
an existing command shell. assuming you are on Windows hit
Windows-R and type cmd to get a Windows> prompt. Then type

C:\WINDOWS> py \path\to\python\file.py

And you should see the program output.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Python-list mailing list