title: Use return key and a button at the same time in tkinter
body: <p>I want to write a program for my biology class... I want to integrate the function that you can type something in the Entry bar and then you can use the button or click the return key. I've the problem, that I just can click the button. Everything else don't work. Here is my code (in a simple form):</p>
  
  <pre><code>from tkinter import *
  import tkinter as tk
  
  # Main Graphic User Interface
  root = Tk()
  root.title("Genetic Translator")
  root.geometry("300x175")
  root.resizable(0,0)
  
  # Solid Label "Information for Input"
  s_label2 = Label(root, text = "\nInput Tripplet which decodes for an amino acid:\n")
  s_label2.pack()
  
  # Entry Bar
  trip = Entry(root)
  trip.pack()
  # Function for setting focus on entry bar
  trip.focus_set()
  
  # Dictionary
  output = {"GCX":"Alanine [Ala]"}
  
  # Dict Function Function (Trans:    trip -in- AS)
  def dict_function1():
      global o_screen
      o_screen.configure(text=(output.get(trip.get().upper(),"Unknown tripplet!")))
  
  # Bind the Return Key for Input
  trip.bind("&lt;Return&gt;", dict_function1)
  
  # Space Label 1
  space_label1 = Label(root)
  space_label1.pack()
  
  # Button "Confirm"
  mainbutton = Button(root, text = "Confirm", command = dict_function1)
  mainbutton.pack()
  
  # Space Label 2
  space_label2 = Label(root)
  space_label2.pack()
  
  # Output Screen
  o_screen = Label(root)
  o_screen.pack()
  
  # Mainloop function for Interface Options
  root.mainloop()
  </code></pre>
  
  <p>Thank you for helping me.</p>