rendered paste bodyimport sys
from Tkinter import *
class makemasta:
def printit(self):
if self.source.get() == "":
self.mylabel.set("Nothing wroten in the Text Field!" + "\n" + self.mylabel.get())
else:
self.mylabel.set(self.source.get() + "\n" + self.mylabel.get())
self.source.set('')
def __init__(self):
self.ss = Tk()
self.ss.title("hello")
self.mylabel = StringVar()
Label(self.ss,text="hello",textvariable=self.mylabel).pack()
self.source = StringVar()
Entry(self.ss,textvariable=self.source).pack()
Button(self.ss,text="Press me!",command=self.printit).pack()
self.ss.mainloop()
makemasta()