title: How to put a textbox into a python tkinter application?
body: <p>I've looked at several other questions and none of them seem to help with my solution. I think I'm just not very intelligent sadly.</p>
  
  <p>Basic question I know. I decided to learn python and I'm making a basic app with tkinter to learn.</p>
  
  <p>Basically it's an app that stores and displays people's driving licence details (name and expiry date). One of the abilities I want it to have is a name lookup. To begin with, I need to figure out how to put a textbox into my window!</p>
  
  <p>I will post the relevant (well, what I think is relevant!) code below:</p>
  
  <pre><code>class search(tk.Frame):
  
  
  def __init__(self, parent, controller):
      tk.Frame.__init__(self, parent)
      label = tk.Label(self, text="Enter a name to display that individual's details", font=LARGE_FONT)
      label.pack(pady=10,padx=10)     
  
      label1 = tk.Label(console, text="Name:").pack()
      searchbox = tk.Entry(console)
      searchbox.pack()
  
  
      button1 = tk.Button(self, text="SEARCH", command=lambda: controller.show_frame(main))#not created yet
      button1.pack()
  
      button2 = tk.Button(self, text="HOME", command=lambda: controller.show_frame(main))
      button2.pack()
  </code></pre>
  
  <p>and of course at the top I have</p>
  
  <pre><code>import tkinter as tk
  </code></pre>
  
  <p>When I try and run this I get "typeobject "search" has no attribute 'tk'". It worked fine - the search window would open when I click the relevant button on the home window. Until I tried to add the Entry box.</p>
  
  <p>What am I doing wrong here? I'm an utter newbie so I'm prepared to face my stupidity</p>
  
  <p>Also apologies if the formatting of this question is awful, I'm a newbie posting here as well. Putting everything into correct "code" format is a real pain</p>