입력란에서 값을 가져 오려고하면 빈 값을 반환합니까? 어떻게 해결할 수 있습니까? 입력란을 문자열 변수로 설정했지만 변수 값은 아무 것도 표시되지 않습니다..get() 입력 상자에 아무 것도 반환하지 않습니까?
import os
import sys
from Tkinter import *
import tkMessageBox
debug = Tk() #prevenets error on 'StringVar()'
debug.withdraw()
#global varables
users_entry = StringVar()
def about():
tkMessageBox.showinfo("About", "...")
def convert():
test = users_entry.get()
print test
def root_window():
#creates main window
root_window = Tk()
root_window.title("convert to binary")
root_window.geometry("600x400")
root_window.resizable(width = FALSE, height =FALSE)
root_window.configure(background = "gray")
#aboutButton
#about_button = Button(root_window, text = "about", command = about, width = 50)
#about_button.grid(row = 0, column = 0, padx = 85, pady = 3)
#entry box for text
users_entry = StringVar()
text_entry = Entry(root_window, text = "test",textvariable = users_entry, width = 70)
text_entry.grid(row = 1, column = 0, pady = 3)
#convert button
convert_button = Button(root_window, text = "convert", command = convert)
convert_button.grid()
root_window.mainloop()
root_window()
debug.mainloop()