[url= Destinos Opuestos (1991) [DVDRip][Spanish][www.zonatorrent.com].avi[/url].Q:
How do I return the text from a textbox in python when button pressed?
I'm having trouble returning the text from a textbox when a button is pressed. I am using the value() method to get it and returning the value but it doesn't seem to work.
from tkinter import *
root = Tk()
root.title("Textbox")
tb_TXT = Text(root, height=3, width=15)
tb_TXT.pack(fill=X)
root.mainloop()
def get_txt():
txt = tb_TXT.value()
return txt
print(get_txt())
A:
In Python2, if you want to return some value from a function, simply return that value. In your example, try this:
def get_txt():
txt = tb_TXT.value()
return txt
print(get_txt())
In Python3, if you want to return a value from a function, simply return an expression using the value() method, so in your example, try this:
def get_txt():
txt = tb_TXT.value()
return txt
print(get_txt())
Q:
From what age do children start developing the problem of wanting to watch too much TV?
Some kids have problems focusing because they're watching TV for hours, from what age do kids start developing this problem?
A:
Bertalan Miklóssy wrote an article on this exact topic:
People's desire to watch TV seems to have increased tremendously
since the Internet came into being. According to a 2003 survey by the
PBS newsmagazine Frontline, an average American child watches five
hours of television a day. That’s a lot of time, considering that a
human brain is not completely developed until around be359ba680
Related links:
Commentaires