Robert Jackson wrote:
> I have a few lines of code as follows:
> 
> CONFIGFILE = raw_input("Enter config location: ")
>     while CONFIGFILE == "":
>          CONFIGFILE = raw_input("You must enter configuration file location: 
> ")
> 
> Let's say the user hits enter past the initial raw_input request.  The user 
> will then be in the while loop.  Any subsequent "enters" by the user will 
> result in a brand new line that reads: "You must enter configuration file 
> location: ".
> 
> Is there a way to clear out the CURRENT line while in the *while* loop so 
> that even if the user hits enter a few extra times, it'll stay in the SAME 
> line that reads "You must enter a configuration file location: " (and not 
> fill up the screen with the same text over and over)?

CONFIGFILE = raw_input("Enter config location: ")
prompt = "You must enter configuration file location: "
while CONFIGFILE == "":
     CONFIGFILE = raw_input(prompt)
     prompt = ""

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to