You are not logged in.

#1 2007-03-15 23:45:34

joni
Member
Registered: 2007-02-04
Posts: 5

Python -> GUI

Hello. I've started to learn Python in the last 2 days. I have heard about PyGTK (I'm using Gnome) and Glade. How can I build the GUI for a simple program. For example a simple "Hello World"? Thaks.

Sorry for my english.

Offline

#2 2007-03-16 00:27:01

stonecrest
Member
From: Boulder
Registered: 2005-01-22
Posts: 1,190

Re: Python -> GUI

pygtk.org


I am a gated community.

Offline

#3 2007-03-16 02:07:00

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Python -> GUI

Having used both PyGTK and WXPython, I'd suggest WXPython is a little easier to use and more featureful. PyGTK has tended to be more stable in the past though.

I don't have python (or even linux :'() installed at the moment, or I'd create a hello world window right inside the python interpreter for you. But since google is awesome, I'll link you:

http://www.google.ca/search?q=hello+world+wxpython

Dusty

Offline

#4 2007-03-16 07:13:18

deficite
Member
From: Augusta, GA
Registered: 2005-06-02
Posts: 693

Re: Python -> GUI

I also suggest WxPython. Whenever I first started using PyGTK I thought it was great. Then I tried to use some very simple, very basic controls and realized how anal PyGTK can really be. I'd like to try PyQT(4) sometime too. Anybody have any experience with it?

Offline

#5 2007-03-16 09:58:18

Speek
Member
Registered: 2005-04-07
Posts: 36

Re: Python -> GUI

Here are some tutorials: http://www.learningpython.com/

Offline

#6 2007-03-16 10:19:51

lemon
Member
From: Norway
Registered: 2006-11-11
Posts: 50

Re: Python -> GUI

import gtk
import gnome.ui
import gtk.glade

wTree = gtk.glade.XML("nameofgladefile.glade")  # Name of the gladefile you made
window = wTree.get_widget("window1") # Name of the main window, you can set the name in glade
window.show()

http://www.pygtk.org/docs/pygtk/index.html

Offline

#7 2007-03-16 12:44:56

Stalwart
Member
From: Latvia, Riga
Registered: 2005-10-18
Posts: 445
Website

Re: Python -> GUI

PyQt4 ftw. I wrote simple ipod manager using it


IRC: Stalwart @ FreeNode
Skype ID: thestalwart
WeeChat-devel nightly packages for i686

Offline

#8 2007-03-16 13:40:00

joni
Member
Registered: 2007-02-04
Posts: 5

Re: Python -> GUI

ok. i think ill learn some wxpython. but there is some tool like glade for python? i have found XRCed http://xrced.sourceforge.net/ its a good tool.

Offline

#9 2007-03-16 14:29:33

skymt
Member
Registered: 2006-11-27
Posts: 443

Re: Python -> GUI

Offline

#10 2007-03-16 18:48:32

pelle.k
Member
From: Åre, Sweden (EU)
Registered: 2006-04-30
Posts: 667

Re: Python -> GUI

I'd like to try PyQT(4) sometime too. Anybody have any experience with it?

I can't comment on QT4 yet, but QT3 is simply awsome. I found it much more straight forward than pyGTK. Unfortunately there is far more pyGTK tutorials floating around the web. qtdoc makes up for that though.


"Your beliefs can be like fences that surround you.
You must first see them or you will not even realize that you are not free, simply because you will not see beyond the fences.
They will represent the boundaries of your experience."

SETH / Jane Roberts

Offline

#11 2007-03-17 05:44:06

gradgrind
Member
From: Germany
Registered: 2005-10-06
Posts: 921

Re: Python -> GUI

pelle.k wrote:

I'd like to try PyQT(4) sometime too. Anybody have any experience with it?

I can't comment on QT4 yet, but QT3 is simply awsome. I found it much more straight forward than pyGTK. Unfortunately there is far more pyGTK tutorials floating around the web. qtdoc makes up for that though.

I have been working on a project using pyqt4 for a while now and am very impressed, though I think pygtk might be easier for a beginner (except maybe the tree/list-view stuff). glade is quite a lot simpler than qtdesigner, which rather confused me with its many features, so I haven't been using it. Qt4 is really very big, with unbelievably many classes and widgets, many of which you wouldn't normally need to touch, but they are there when you need them (gtk is at present a bit more limited). The documentation is pretty good, but doesn't cover absolutely everything you might need to know. I have had to work out quite a bit myself by guessing and playing around. I'm not absolutely sold on some of the features (such as the signals/slots implementation), but I would certainly recommend giving it a look, it feels really solid and comprehensive.

Oh, and if you are in the unfortunate position of needing to write code which which also run on w****ws, pyqt4 looks like a pretty good choice.

My (very limited) experience with wxpython was not so positive (it seemed buggy and the documentation confused as often as it enlightened me), but as that could just be my problem I'll not say any more about it.

Offline

#12 2007-04-15 21:13:20

N30N
Member
Registered: 2007-04-08
Posts: 273

Offline

#13 2007-04-17 02:12:05

deficite
Member
From: Augusta, GA
Registered: 2005-06-02
Posts: 693

Re: Python -> GUI

except maybe the tree/list-view stuff

Doing tree/list-view stuff made me angry. I sobbed like a little girl. Then I used WxPython and all my tears dried away (though some of the design choices the wxPython devs made irritated me). Then I tried PyQT4 and the room brightened and rainbows surrounded me. A blind man that was walking in front of my house gained back his sense of vision, and the corpse of a dead dog rose and did a flip, happy to be alive once more.

Offline

#14 2007-04-17 20:34:02

pelle.k
Member
From: Åre, Sweden (EU)
Registered: 2006-04-30
Posts: 667

Re: Python -> GUI

Then I tried PyQT4 and the room brightened and rainbows surrounded me. A blind man that was walking in front of my house gained back his sense of vision, and the corpse of a dead dog rose and did a flip, happy to be alive once more.

That's freakin awsome bro'. smile It it sounds so great in your poetical words...


"Your beliefs can be like fences that surround you.
You must first see them or you will not even realize that you are not free, simply because you will not see beyond the fences.
They will represent the boundaries of your experience."

SETH / Jane Roberts

Offline

#15 2007-04-17 21:10:24

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Python -> GUI

hahaha!

That is the funniest thing I have read on the forums in months!


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#16 2007-04-17 23:38:22

Zer0
Member
From: Windsor, ON, Canada
Registered: 2006-08-25
Posts: 299

Re: Python -> GUI

pelle.k wrote:

Then I tried PyQT4 and the room brightened and rainbows surrounded me. A blind man that was walking in front of my house gained back his sense of vision, and the corpse of a dead dog rose and did a flip, happy to be alive once more.

That's freakin awsome bro'. smile It it sounds so great in your poetical words...

LMAO.. and some say Python is a beginners language.. sounds pretty damn powerful to me!

Could we see a snippit of code you used to witness these things?

Best Post Ever!

Offline

#17 2007-04-18 01:35:11

stonecrest
Member
From: Boulder
Registered: 2005-01-22
Posts: 1,190

Re: Python -> GUI

I personally love pygtk.


I am a gated community.

Offline

#18 2007-04-19 22:13:07

chaosgeisterchen
Member
From: Kefermarkt, Upper Austria
Registered: 2006-11-20
Posts: 550

Re: Python -> GUI

The python's bite's an antidote to poison inflicted on humans and other entities by way too complex programming?

Sounds nice nontheless.

I like poetical wording, wherever it may find its usage.


celestary
Intel Core2Duo E6300 @ 1.86 GHz
kernel26
KDEmod current repository

Offline

Board footer

Powered by FluxBB