Is There an Gui Designer for Python?

Is There an Gui Designer for Python?

Is there a GUI IDE for programming python just like java has netbeans?

I wanted one where we could drag & drop test boxes & labels just as we do in swing components using netbeans or eclipse.

Or is there an add-on present in either netbeans or eclipse itself?

4

10 Answers

Glade

If you want a wysiwyg GUI designer, Glade is your best bet:

  • first, install glade from the software centre
  • create your GUI, save it as, say, myapp.glade

  • Go to the signals tab and set up your callback, such as on_window1_destroy

  • In your python program, tell GTK to load the UI definitions

    import gtk
    
    
    class MyApp (object):
    
        def __init__(self):
            self.builder = gtk.Builder()
            self.builder.add_from_file("myapp.glade")
            self.builder.connect_signals(self)
    
        def run(self):
            self.builder.get_object("window1").show_all()
            gtk.main()
    
        def on_window1_destroy(self, *args):
            gtk.main_quit()
    
    
    MyApp().run()
    

After getting everything set up, you can dive straight into the Glade tutorial (as Jeremy Kerr mentioned in his answer). Start by learning about the different lay–out options and signals.


Quickly

When you feel comfortable with glade, you can start using it via Quickly, which is a set of programs to make the common tasks in developing software very easy. It takes care of translations, storing configuration, packaging, launchpad integration including PPAs, and lots more:

sudo apt-get install quickly
quickly create ubuntu-application hello-world
cd hello-world/

Quickly now creates a huge project with everything you need already set up. A gui, the translation files, configuration via desktopcouch, and so on.

You'll see quickly sets up a few windows (the main App, configuration, and an about dialogue) for you. To start editing your GUI:

  • run quickly design

  • To get to the app's code, run quickly edit

  • Go to the HelloWorldWindow.py file

  • Now start adding signal handlers and logic.

Finally, to run your application, type quickly run.

At this point, you can get into the PyGTK documentation in order to learn about the signals, their handlers' signatures, the different widgets' methods and so on.


See also, some related questions:

2

Qt-Designer

PyQt comes with Qt's Designer, which is a pretty neat graphical GUI editor, if you fancy to write your app with the Qt framework.

Sophia Al-Mansoor
Author

Sophia Al-Mansoor

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.