def Command_Open(): return def Command_Save(): return def Command_Print(): return def Command_New(): return # Here we write a new function to get a string from # the user and always return the capitalizd version. # We can call the function anywhere such a string is # desired. Notice that the call to MyInput passes it # the actual parameter "Enter a command --- ", which # inside MyInput comes in as formal parameter Message, # which is then passed straight on to the input function. def MyInput (Message): # Function to get a string and capitalize it S = input(Message) return S.upper() def Main(): MoreToDo = True while MoreToDo: Command = MyInput("Enter a command --- ") if Command == "QUIT": MoreToDo = False elif Command == "OPEN": Command_Open() # Call stub elif Command == "SAVE": Command_Save() # Call stub elif Command == "PRINT": Command_Print() # Call stub elif Command == "NEW": Command_New() # Call stub elif Command == "EDIT": pass # Do nothing, replace with stub call later elif Command == "COPY": pass # Do nothing, replace with stub call later else: print ("Illegal Command") return