The StringVar.get() method returns a blank value when the function c() is called. However, it works perfectly fine when I call only the new_db () function. I really cannot understand the problem. Could somebody explain it to me?
#modules
import os
from Tkinter import *
chance=3
def cr():
print data.get()
#new_db
def new_db():
global data
m.destroy()
new=Tk()
data=StringVar()
Entry(new,font='BRITANIC 16',textvariable=data).grid(column=1,row=2)
Button(new,text='Create New Database',command=cr).place(x=175,y=75)
new.geometry('500x100+400+250')
new.mainloop()
def c():
global m
m=Tk()
Button(m,text='erferf',command=new_db).pack()
m.mainloop()
c()