def Command_Open(): return def Command_Save(): return def Command_Print(): return def Command_New(): return def MyInput (Message): # Function to get a string and capitalize it S = input(Message) return S.upper() # Python supports more different types of strings than # just "double-quoted" or 'single-quoted' strings. If # you surround a string with """triple-double""" or # '''triple-single''' quotes, the string is allowed to # span line breaks, and the line breaks will be included # in the string itself. Notice that variable Message # is assigned a four-line string, where the first three # lines might contain instructions to the user, and the # last contains the prompt indicating the place to type # in a response. This is passed to MyInput (and then # on to input), so the entire four-line string is printed # each time the user is requested for input. def Main(): Message = """Line #1 of instructions Line #2 of instructions Line #3 of instructions Enter a command --- """ MoreToDo = True while MoreToDo: Command = MyInput(Message) 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