Inside of my program there is a definition that opens a window (this window is the code below) in this window I want to be able to set a variable using an entry box and then outside of window be able to call that variable with the set integer.
To test my code there is an accept and test button. If I can type in a number, press accept then press test it should print that number. currently it prints class int.
from tkinter import *
fuel_stored = int
def Accept():
Varible = number1.get()
fuel_stored = Variable
print (Varible)
def PrintFuel():
print (fuel_stored)
root = Tk()
root.geometry=("100x100+100+50")
number1 = Entry(root, bg="white")
number1.pack()
number1.focus_force()
nameButton = Button(root, text="Accept", command=Accept)
nameButton.pack(side=BOTTOM, anchor=S)
nameButton = Button(root, text="Test", command=PrintFuel)
nameButton.pack(side=BOTTOM, anchor=S)
root.mainloop()