Advertisement
Guest User

Untitled

a guest
Oct 19th, 2015
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. commands = {
  2.     "start": start,
  3.     "stop": stop,
  4.     "quit": quit
  5. }
  6.  
  7. while True:
  8.     command = input("command: ").split()
  9.     if command and command[0] in commands:
  10.         try:
  11.             command[0](*command[1:])
  12.         except TypeError:
  13.             print("Not enough arguments")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement