from Tkinter import *
root = Tk()
root.title("Whois Tool")
text = Text()
text1 = Text()
text1.config(width=15, height=1)
text1.pack()
def button1():
text.insert(INSERT, text1.get("1.0", END))
b = Button(root, text="Enter", width=10, height=2, command=button1)
b.pack()
scrollbar = Scrollbar(root)
scrollbar.pack(side=RIGHT, fill=Y)
text.config(width=60, height=15)
text.pack(side=LEFT, fill=Y)
scrollbar.config(command=text.yview)
text.config(yscrollcommand=scrollbar.set)
root.mainloop()
The above script works without any exception errors, but if I modify import style: import Tkinter as Tk, it will complain about about argument 'LEFT, RIGHT, Y' and I had to make them lower letter in string form as below script, why is that?
import Tkinter as tk
root = tk.Tk()
root.title("Whois Tool")
text = tk.Text()
text1 = tk.Text()
text1.config(width=15, height=1)
text1.pack()
def button1():
text.insert('insert', text1.get("1.0", 'end'))
# text.insert(END, text1)
b = tk.Button(root, text="Enter", width=10, height=2, command=button1)
b.pack()
scrollbar = tk.Scrollbar(root)
scrollbar.pack(side='right', fill='y')
text.config(width=60, height=15)
text.pack(side='left', fill='y')
scrollbar.config(command=text.yview)
text.config(yscrollcommand=scrollbar.set)
root.mainloop()