how can I run python interactively?

Fredrik Lundh fredrik at pythonware.com
Thu Nov 3 01:48:28 EST 2005


"questions?" wrote:

> I need to stop the program in the middle and pause there.
>
> Are there anyway I can stop the program in the middle and have
> something like:
>
> please press y to continue.....

portable:

    raw_input("please press return to continue.....")

to get a single character, you can use msvcrt.getch() on windows,
or the termios module on unix:

    http://effbot.org/librarybook/msvcrt.htm
    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/134892
    http://www.faqts.com/knowledge_base/view.phtml/aid/4490/fid/538
    etc

</F>






More information about the Python-list mailing list