Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tunasushi

macrumors newbie
Original poster
Sep 5, 2011
10
0
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

macrumors 6502
Mar 12, 2010
274
0
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

macrumors newbie
Original poster
Sep 5, 2011
10
0
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

macrumors 65816
Dec 16, 2010
1,449
1
Sydney
Python's "standard" GUI library is TkInter. tkSimpleDialog's askstring should be able to do what you want it to.

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

tunasushi

macrumors newbie
Original poster
Sep 5, 2011
10
0
Thanks jiminaus! As I explained before, I am not fluent in Python, but can work with it if given code. This really helped me!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.