Socket programming help

Discussion in 'Mac Programming' started by tunasushi, Jan 29, 2012.

  1. tunasushi macrumors newbie

    Sep 5, 2011
    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!
  2. willieva macrumors 6502

    Mar 12, 2010
    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.
  3. tunasushi thread starter macrumors newbie

    Sep 5, 2011
    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.
  4. jiminaus, Jan 29, 2012
    Last edited: Jan 29, 2012

    jiminaus macrumors 65816


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

    For example:
    from Tkinter import Tk
    from tkSimpleDialog import askstring
    root = Tk()
    result = askstring('askstring test', 'Enter something here:')
    if result != None:
    	print result
  5. tunasushi thread starter macrumors newbie

    Sep 5, 2011
    Thanks jiminaus! As I explained before, I am not fluent in Python, but can work with it if given code. This really helped me!

Share This Page