Replace for Goto

John Roth johnroth at ameritech.net
Thu May 29 06:56:58 EDT 2003


"Dvm5" <dvm5_0 at hotmail.com> wrote in message
news:aa2e3602.0305281646.32cf1129 at posting.google.com...
> I'm used to Basic. There is a Goto/Label command, you put goto where
> you want it to come from and label where you want it to go. Simple.
> How can I do this in Python?
>
> What I'm trying to do is create a "play again" type user interface.
> Thus, I can't alter the program to use an If command; the option has
> to be at the end, and the effect has to be at the begining! How do I
> accomplish this?
>
> If there is another way, other than a similar thing to Goto, tell me
> that, as well as a similar thing for goto. It would probably be useful
> later on...
>
> Thanks for all help ^_^

Since I don't know what you mean by a "play again" command,
I'll have to guess. The way I'd do it would be to use something
similar to the Command Pattern: that is, record the
last command, and invoke your command parser directly
on the stored command.

John Roth






More information about the Python-list mailing list