Is there an easy way to do it again?

Preston Landers prestonlanders at my-deja.com
Mon Dec 20 17:38:50 EST 1999


Put the task into a function, then do something like this:

while 1:
    do_menial_task()
    answer = raw_input("Run task again? y or n > ")
    if answer in ["n", "no", "N", "quit"]:
        break



In article <83jvjd$k0r$1 at news05.btx.dtag.de>,
  "Eide" <nickliz at t-online.de> wrote:
> I wrote a simple program  to do a menial task and it works just fine,
but
> I'm wondering what the best way is to ask the user to run it again.
Do I
> set the whole thing in a while loop, or call the prog as a function,
or
> what?
>
> Thanks for helping a newbie.
>
>

--
|| Preston Landers <prestonlanders at my-deja.com> ||


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list