title: Print to the IDLE Shell when a tkinter button is pressed
body: <p>I am trying to create a small window that shows up in the corner of your screen. The window will have a keyboard on it. I want to be able to make the computer think that you pressed a button on your keyboard when a button in the window is pressed. This is the code I have so far:</p>
  
  <pre><code>from tkinter import *
  
  top = Tk()
  frame1 = Frame(top)
  btn = Button(frame1,text="q",command=  'print("q",end="")')
  btn2 = Button(frame1,text="w",command= 'print("w",end="")')
  btn3 = Button(frame1,text="e",command= 'print("e",end="")')
  btn4 = Button(frame1,text="r",command= 'print("r",end="")')
  btn5 = Button(frame1,text="t",command= 'print("t",end="")')
  btn6 = Button(frame1,text="y",command= 'print("y",end="")')
  btn7 = Button(frame1,text="u",command= 'print("u",end="")')
  btn8 = Button(frame1,text="i",command= 'print("i",end="")')
  btn9 = Button(frame1,text="o",command= 'print("o",end="")')
  btn10 = Button(frame1,text="p",command='print("p",end="")')
  frame2 = Frame(top)
  btn11 = Button(frame2,text="a",command='print("a",end="")')
  btn12 = Button(frame2,text="s",command='print("s",end="")')
  btn13 = Button(frame2,text="d",command='print("d",end="")')
  btn14 = Button(frame2,text="f",command='print("f",end="")')
  btn15 = Button(frame2,text="g",command='print("g",end="")')
  btn16 = Button(frame2,text="h",command='print("h",end="")')
  btn17 = Button(frame2,text="j",command='print("j",end="")')
  btn18 = Button(frame2,text="k",command='print("k",end="")')
  btn19 = Button(frame2,text="l",command='print("l",end="")')
  frame3 = Frame(top)
  btn20 = Button(frame3,text="z",command='print("z",end="")')
  btn21 = Button(frame3,text="x",command='print("x",end="")')
  btn22 = Button(frame3,text="c",command='print("c",end="")')
  btn23 = Button(frame3,text="v",command='print("v",end="")')
  btn24 = Button(frame3,text="b",command='print("b",end="")')
  btn25 = Button(frame3,text="n",command='print("n",end="")')
  btn26 = Button(frame3,text="m",command='print("m",end="")')
  btnArr1 = [btn,btn2,btn3,btn4,btn5,btn6,btn7,btn8,btn9,btn10]
  btnArr2 = [btn11,btn12,btn13,btn14,btn15,btn16,btn17,btn18,btn19]
  btnArr3 = [btn20,btn21,btn22,btn23,btn24,btn25,btn26]
  for x in range(0,len(btnArr1),1):
      btnArr1[x].pack(side=LEFT)
  frame1.pack()
  for x in range(len(btnArr2)-1,-1,-1):
      btnArr2[x].pack(side=RIGHT)
  frame2.pack()
  for x in range(len(btnArr3)-1,-1,-1):
      btnArr3[x].pack(side=RIGHT)
  frame3.pack()
  top.mainloop()
  </code></pre>
  
  <p>When I run it, it does nothing. I tried using the plain code without the single quotes, and I tried using an <code>exec()</code> statement in the command parameter. Both tries failed. </p>
  
  <p>I am using python 3.6.2</p>
  
  <p>If anyone has any idea why this is, I would love to hear what you have to say. Thank you for your time! </p>