title: Combining HTML and Tkinter Text Input
body: <p>I'm looking for some help in finding a way to construct a body of text that can be implemented within an HTML document upon users inputting their text to display in an Entry. I have figured out the following on how to execute the browser to open in a new window when clicking the button and displaying the HTML string. However, the area I am stuck on is grabbing the user input inside the wbEntry variable to function with the HTML string outputted by 'message'. I was looking at lambda's to use as a command within wbbutton, but not sure if that's the direction to look for a solution. </p>
  
  <pre><code>from tkinter import *
  import webbrowser
  
  def wbbrowser():
      f = open('index.html','w')
      message = "&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;This is a test&lt;/p&gt;&lt;/body&lt;/html&gt;"
      f.write(message)
      f.close()
      webbrowser.open_new_tab('index.html')
  
  
  wbGui = Tk()
  source = StringVar()
  
  
  wbGui.geometry('450x450+500+300')
  wbGui.title('Web Browser')
  
  wblabel = Label(wbGui,text='Type Your Text Below').pack()
  
  wbbutton = Button(wbGui,text="Open Browser",command = wbbrowser).pack()
  
  wbEntry = Entry(wbGui,textvariable=source).pack()
  </code></pre>
  
  <p>I am using Python 3.5 and Tkinter on a Windows 7. The code above does not operate for me on my Mac OSX as that would require a different setup for my wbbrowser function. Any help would be appreciated.</p>