[Tutor] Running Python from Windows command line
Remco Gerlich
scarblac@pino.selwerd.nl
Tue, 11 Jul 2000 17:17:21 +0200
On Tue, Jul 11, 2000 at 10:30:55AM -0700, Geoffrey Bays wrote:
> How do I run Python from the Windows 98 'run' line? When I try to do so,
> the MS-DOS window pops up for a flash and then vanishes.
> I have been working through 'Learning Python' running all modules from the
> interactive interpreter using the 'import' command. I want to try the "
> if__name__ == "__main__': " test in the book, but can't do so without
> running modules from the command line.
> My apologies for such a newbie and windows related question. Thanks
You can just open a DOS box and give the Python command from there, so that
the window stays when the program is finished.
Or end your program with a 'raw_input("Hit enter to leave...")'.
There may be more sophisticated ways to do it, but I don't use Windows so
I don't know :)
--
Remco Gerlich, scarblac@pino.selwerd.nl