[Tutor] A command line

Kirby Urner urnerk@qwest.net
Sat, 06 Oct 2001 12:49:32 -0700


>
>   >>> def interpreter(prompt='=> '):
>          while 1:
>              command = raw_input(prompt)
>              if command:
>                 rval = commands(command)
>                 if not rval:
>                      break
>          else:  break

Sorry about the indentation problem.

Here's a slightly modified version:

  >>> def interpreter(prompt='=> '):
         while 1:
             command = raw_input(prompt)
             if command:
                if not commands(command)
                     break
             else:  break

Kirby