Re: GUI, Python2.7- how to build a loop with a button + textbox
On Tue, 11 Sep 2018 19:51:01 -0700 (PDT), alon.naj...@gmail.com wrote: > hi, > > on python 2.7 how do I build a loop with a button + textbox? > > for example: > > I want the user to enter is name and then press "ok" button, I want > his name to be printed 5 times. Tested on Python 3.5.3: import browsergui as bg def button_clicked(): for i in range(5): print(text_field.value) text_field = bg.TextField() bg.GUI(text_field, bg.Button("OK", callback=button_clicked)).run(quiet=True) If you don't have browsergui, "pip install browsergui". -- To email me, substitute nowhere->runbox, invalid->com. -- https://mail.python.org/mailman/listinfo/python-list
Re: GUI, Python2.7- how to build a loop with a button + textbox
On 12/09/18 04:51, alon.naj...@gmail.com wrote: hi, on python 2.7 Please use Python 3. how do I build a loop with a button + textbox? There are many GUI libraries. Tkinter is part of the standard library and appears to be well-documented. https://docs.python.org/3/library/tkinter.html A good (and normally less ugly) alternative is Qt, using either PyQt5 or PySide2 for Python bindings. for example: I want the user to enter is name and then press "ok" button, I want his name to be printed 5 times. thanks! :) you people are amazing it's almost better then stackoverflow :D -- https://mail.python.org/mailman/listinfo/python-list