I have two python files, one in which i store the code inputData.py and one which is the main file, main_project.py.
In inputData i have this code:
class Prompt(tk.Tk):
def __init__(self):
tk.Tk.__init__(self)
self.entry = tk.Entry(self)
self.button = tk.Button(self, text="Get", command=self.on_button)
self.button.pack()
self.entry.pack()
def on_button(self):
self.inputDt = self.entry.get()
In main_project i have this code:
from inputData import Prompt
promptData = Prompt()
promptData.mainloop()
class Hearing(object):
numberBirths = promptData.inputDt
What i am trying to do is to assign the value numberBirths the value from the input in tkinter, and after i do that, i need the prompt to close and continue with the rest of the code. Can you help me with that?