Stop code in python!!

Alan Gauld alan.gauld at btinternet.com
Mon Mar 15 13:15:51 EST 2004


On Mon, 15 Mar 2004 15:19:52 +0100, "The Radiator" <The at Radiator>
wrote:

> I have this code, but I shall have a pause in  the end. Would you plaese
> give me some idears to this, or/and write the code better!
> 
> p = (raw_input("Password please: "))
> if p == "root":
>     print ""
>     print "Welcome"
>     print "to this game, hope you will enjoy!"
>     print "But remeber, it still under construktion!!"
>     print ""
> m = (raw_input("Will you move on to level 2? (y/n)"))
> print ""
> if m == "n":
>     print "Goodbye!!"
> else:
>     if m == "y":
>         print "Hey, this here is level 2"
>         print "but it is still under construction"
> 
If you just want the program to stop so that you can see the
output try adding a raw_input() line at the end:

raw_input("Hit Enter to quit...")

Alternatively don't double click but actually run it from inside
a DOS prompt(assuming you are on Windoze) or within IDLE.

BTW You might find it helpful to join the Python tutor mailing
list which is geared to helping beginners. Find the sign up page
under Communities->Mailing Lists on the Python web site.

HTH

Alan G.
Author of the Learn to Program website
http://www.freenetpages.co.uk/hp/alan.gauld



More information about the Python-list mailing list