Restarting a program

Geoldr geoldr at gmail.com
Thu May 22 14:38:05 EDT 2008


On May 22, 10:07 am, Mike Driscoll <kyoso... at gmail.com> wrote:
> On May 22, 10:59 am, Geoldr <geo... at gmail.com> wrote:
>
> > Hello all, I have written a simple program, and at the end of it,
> > instead of it closing I would like it to restart from the beggining.
> > Is there a way to do this? Put my code into a class function, or
> > something?
> > I guess I could do a while loop, but I think if there is a way to run
> > my code if it's in a class would be an easier option. I can't seem to
> > find many guides online but maybe I have not been looking in the right
> > places.
>
> > Anybody have any ideas?
>
> Putting your code in a function or class is probably the way to go.
> When I was doing C++, we'd just use a while loop for simple stuff,
> though.
>
> It really shouldn't be all that hard to tell the code to call up the
> beginning of the program again.
>
> Mike

That's what I am trying to figure out, but it doesn't seem to work. Do
you have any example code of classes/functions that work for you?



More information about the Python-list mailing list