[Tutor] Infinite program

Bernard Lebel python at bernardlebel.com
Sat Aug 21 23:37:43 CEST 2004


Use a while loop. It will keep repeating until a false condition is met.

Example:

bRedo = True

while bRedo == True:
    if .....:
        do something
    else:
        bRedo = False


Cheers
Bernard

----- Original Message ----- 
From: "Pavel Brabec" <PBoa at seznam.cz>
To: <tutor at python.org>
Sent: Saturday, August 21, 2004 9:31 PM
Subject: [Tutor] Infinite program


> Hi there,
>
> I have a program written in a single module. It should ask user what to
> do, than do it and ask what to do again. But I do not know how to
> re-execute efficiently the program. I tried 2 functions calling
> themselves ( e.g. function Ask()  will call function DoIt() that will
> call function Ask() that will call...). I am beginner with programming
> but I think that this is not ideal flow of execution  (reading Traceback
> is a horror) :-(  and  I do not think how to archive similar
functionality.
>
> I have also tried to play with Built-In function reload() but i do not
> want to reload another imported module, I want to reload the one from
> which I am calling the reload(). Is there a possibility to do something
> like that?
>
> Regards,
> Pavel Brabec
>
> -- 
> In the beginning was the word
> and the word was content-type: plain/text
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>



More information about the Tutor mailing list