title: Python 2.7 Tkinter open webbrowser on click
body: <pre><code>from Tkinter import *
  import webbrowser
  
  root = Tk()
  frame = Frame(root)
  frame.pack()
  
  url = 'http://www.sampleurl.com'
  
  def OpenUrl(url):
      webbrowser.open_new(url)
  
  button = Button(frame, text=&quot;CLICK&quot;, command=OpenUrl(url))
  
  button.pack()
  root.mainloop()
  </code></pre>
  <p>My goal is to open a URL when I click the button in the GUI widget. However, I am not sure how to do this.</p>
  <p>Python opens two new windows when I run the script without clicking
  anything. Additionally, nothing happens when I click the button.</p>