title: How do populate a Tkinter optionMenu with items in a list
body: <p>"I want to populate option menus in Tkinter with items from various lists, how do i do that? In the code below it treats the entire list as one item in the menu. I tried to use a for statement to loop through the list but it only gave me the value 'a' several times.</p>
  
  <pre><code>from Tkinter import *
  
  def print_it(event):
    print var.get()
  
  root = Tk()
  var = StringVar()
  var.set("a")
  lst = ["a,b,c,d,e,f"]
  OptionMenu(root, var, lst, command=print_it).pack()
  root.mainloop()
  </code></pre>
  
  <p>I want to now pass the variable to this function, but i'm getting a syntax error for the second line:</p>
  
  <pre><code>def set_wkspc(event):
    x = var.get()
    if x = "Done":
        break
    else:
        arcpy.env.workspace = x
    print x
  </code></pre>