[Tutor] Unable to open .py files directly

Alan Gauld alan.gauld at btinternet.com
Mon Mar 19 18:56:06 CET 2012


On 19/03/12 14:30, Surya K wrote:
> Hi there,
>
> I am facing a typical problem in opening .py files by clicking them (In
> windows).
>
> When ever I those files, there's a black window opening and closing
> immediately (I think, its output of python at python command line, NOT
> SURE). I have to open those files from IDE's or any test editors.

The simplest solution is just to add a line like:

Python 2.x:

raw_input("Hit any key to quit...")


Python 3.x

raw_input("Hit any key to quit...")

There are various other options. They are discussed in my tutor in the
"Add a little style" topic near the bottom.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list