PDA

View Full Version : Socket programming help




tunasushi
Jan 29, 2012, 04:39 PM
I have a command line python script that does some socket programming I need to do. I don't know that much about python, but I know how object-oriented programming works and the basics of it. My question is, what is the simplest way to make a gui for the program. I just need to have a text box and a send button. If I could get a pointer to some bits of code or programs, that would really help. I don't care at all if the program is written in python, C++ would be better in fact, I just need it to do a simple task with a simple GUI. Thanks!



willieva
Jan 29, 2012, 08:15 PM
You don't want socket help, you want gui help. You'll get better answers if the topic reflects what you really want to know.

tunasushi
Jan 29, 2012, 09:08 PM
You don't want socket help, you want gui help. You'll get better answers if the topic reflects what you really want to know.

Thanks for the info, so I will rephrase my question: Does anyone know what is the easiest/best way to create a GUI for python? Thanks.

jiminaus
Jan 30, 2012, 12:26 AM
Python's "standard" GUI library is TkInter (http://wiki.python.org/moin/TkInter). tkSimpleDialog's askstring (http://www.pythonware.com/library/tkinter/introduction/x1164-data-entry.htm) should be able to do what you want it to.

For example:

from Tkinter import Tk
from tkSimpleDialog import askstring
root = Tk()
root.withdraw()
result = askstring('askstring test', 'Enter something here:')
if result != None:
print result

tunasushi
Jan 31, 2012, 05:38 PM
Thanks jiminaus! As I explained before, I am not fluent in Python, but can work with it if given code. This really helped me!