original_docstring:  Constructs a GUI with stuff on it. 
docstring: Constructs a GUI with stuff on it.
docstring_tokens: Constructs a GUI with stuff on it .
code: def main():
      """ Constructs a GUI with stuff on it. """
      # -------------------------------------------------------------------------
      # DONE: 2. After reading and understanding the m1e module,
      #   ** make a window that shows up. **
      # -------------------------------------------------------------------------
      window = tkinter.Tk()
      # window.mainloop()
      # -------------------------------------------------------------------------
      # DONE: 3. After reading and understanding the m2e module,
      #   ** put a Frame on the window. **
      # -------------------------------------------------------------------------
      frame = ttk.Frame(window, padding=20)
      frame.grid()
      # -------------------------------------------------------------------------
      # DONE: 4. After reading and understanding the m2e module,
      #   ** put a Button on the Frame. **
      # -------------------------------------------------------------------------
      button = ttk.Button(frame, text='this is a button')
      button.grid()
      # -------------------------------------------------------------------------
      # DONE: 5. After reading and understanding the m3e module,
      #   ** make your Button respond to a button-press **
      #   ** by printing   "Hello"  on the Console.     **
      # -------------------------------------------------------------------------
      button['command'] = (lambda: print('hello'))
      # -------------------------------------------------------------------------
      # DONE: 6. After reading and understanding the m4e module,
      #   -- Put an Entry box on the Frame.
      #   -- Put a second Button on the Frame.
      #   -- Make this new Button, when pressed, print "Hello"
      #        on the Console if the current string in the Entry box
      #        is the string 'ok', but print "Goodbye" otherwise.
      # -------------------------------------------------------------------------
      enter = ttk.Entry(frame)
      enter.grid()
      buttony = ttk.Button(frame, text='this will either print hello or goodbye')
      buttony['command'] = (lambda: do_it(enter))
      buttony.grid()
  
      # -------------------------------------------------------------------------
      # DONE: 7.
      #    -- Put a second Entry on the Frame.
      #    -- Put a third Button on the frame.
      #    -- Make this new Button respond to a button-press as follows:
      #
      #    Pressing this new Button causes the STRING that the user typed
      #    in the FIRST Entry box to be printed N times on the Console,
      #      where N is the INTEGER that the user typed
      #      in the SECOND Entry box.
      #
      #    If the user fails to enter an integer,
      #    that is a "user error" -- do NOT deal with that.
      #
      # -------------------------------------------------------------------------
      ####################################################################
      # HINT:
      #   You will need to obtain the INTEGER from the STRING
      #   that the GET method returns.
      #   Use the   int   function to do so, as in this example:
      #      s = entry_box.get()
      #      n = int(s)
      ####################################################################
      another_entry = ttk.Entry(frame)
      another_entry.grid()
      another_button = ttk.Button(frame, text='press it chief')
      another_button['command'] = (lambda: mhmm(enter, another_entry))
      another_button.grid()
      window.mainloop()
      # -------------------------------------------------------------------------
      # DONE: 8. As time permits, do other interesting GUI things!
      # -------------------------------------------------------------------------
code_tokens: def main ( ) : window = tkinter . Tk ( ) frame = ttk . Frame ( window , padding = 20 ) frame . grid ( ) button = ttk . Button ( frame , text = 'this is a button' ) button . grid ( ) button [ 'command' ] = ( lambda : print ( 'hello' ) ) enter = ttk . Entry ( frame ) enter . grid ( ) buttony = ttk . Button ( frame , text = 'this will either print hello or goodbye' ) buttony [ 'command' ] = ( lambda : do_it ( enter ) ) buttony . grid ( ) another_entry = ttk . Entry ( frame ) another_entry . grid ( ) another_button = ttk . Button ( frame , text = 'press it chief' ) another_button [ 'command' ] = ( lambda : mhmm ( enter , another_entry ) ) another_button . grid ( ) window . mainloop ( )
short_docstring: Constructs a GUI with stuff on it.
short_docstring_tokens: Constructs a GUI with stuff on it .
comment: """ Constructs a GUI with stuff on it. """$SEP$# -------------------------------------------------------------------------$SEP$# DONE: 2. After reading and understanding the m1e module,$SEP$#   ** make a window that shows up. **$SEP$# -------------------------------------------------------------------------$SEP$# window.mainloop()$SEP$# -------------------------------------------------------------------------$SEP$# DONE: 3. After reading and understanding the m2e module,$SEP$#   ** put a Frame on the window. **$SEP$# -------------------------------------------------------------------------$SEP$# -------------------------------------------------------------------------$SEP$# DONE: 4. After reading and understanding the m2e module,$SEP$#   ** put a Button on the Frame. **$SEP$# -------------------------------------------------------------------------$SEP$# -------------------------------------------------------------------------$SEP$# DONE: 5. After reading and understanding the m3e module,$SEP$#   ** make your Button respond to a button-press **$SEP$#   ** by printing   "Hello"  on the Console.     **$SEP$# -------------------------------------------------------------------------$SEP$# -------------------------------------------------------------------------$SEP$# DONE: 6. After reading and understanding the m4e module,$SEP$#   -- Put an Entry box on the Frame.$SEP$#   -- Put a second Button on the Frame.$SEP$#   -- Make this new Button, when pressed, print "Hello"$SEP$#        on the Console if the current string in the Entry box$SEP$#        is the string 'ok', but print "Goodbye" otherwise.$SEP$# -------------------------------------------------------------------------$SEP$# -------------------------------------------------------------------------$SEP$# DONE: 7.$SEP$#    -- Put a second Entry on the Frame.$SEP$#    -- Put a third Button on the frame.$SEP$#    -- Make this new Button respond to a button-press as follows:$SEP$#$SEP$#    Pressing this new Button causes the STRING that the user typed$SEP$#    in the FIRST Entry box to be printed N times on the Console,$SEP$#      where N is the INTEGER that the user typed$SEP$#      in the SECOND Entry box.$SEP$#$SEP$#    If the user fails to enter an integer,$SEP$#    that is a "user error" -- do NOT deal with that.$SEP$#$SEP$# -------------------------------------------------------------------------$SEP$####################################################################$SEP$# HINT:$SEP$#   You will need to obtain the INTEGER from the STRING$SEP$#   that the GET method returns.$SEP$#   Use the   int   function to do so, as in this example:$SEP$#      s = entry_box.get()$SEP$#      n = int(s)$SEP$####################################################################$SEP$# -------------------------------------------------------------------------$SEP$# DONE: 8. As time permits, do other interesting GUI things!$SEP$# -------------------------------------------------------------------------