PyKDE

Boudewijn Rempt boud at rempt.xs4all.nl
Mon Feb 18 17:08:24 EST 2002


Mik Mifflin <dogansmoobs at nospam.prexar.com> wrote:
> I'm trying to learn Qt programming and decided to use my new favorite 
> language (Python, of course).  I'm using SuSE 7.3, and there is an rpm 
> called PyQt installed, but it looks like I need PyKDE as well?  This is the 
> program that I'm trying to run, and the error messages it gives:

> !/usr/bin/python
> from qt import *
> from kdecore import *
> from kdeui import *

> a = KApplication (sys.argv)
> w = QWidget()
> a.setMainWidget (w)
> a.setTopWidget (w)
> w.resize (200, 200)
> w.show()
> a.exec_loop()

>> ./qt1
>   File "./qt1", line 3, in ?
>     from kdecore import *
> ImportError: No module named kdecore

> If I do need PyKDE, does anyone know of an rpm that will work with SuSE?  
> Or am I just better off installing from source?

Yes -- to use KDE modules, you need PyKDE. Now there's some complication,
since KDE is quite complex, and it's only very recently that Jim Bublitz
has succeeded in binding most of KDE to Python. You can find his work at:
http://www.thekompany.com/projects/pyqt. As far as I know, there are no
rpm's of PyKDE available.

This might be a good moment to officially note that my PyKDE tutorial
only works with KDE 1.1.2, and the attendant PyKDE... Which means that
it isn't all that useful. From your code it looks like you're using
my stuff...

But my book on PyQt, from http://www.opendocs.org, has just come back
from the printer, which means that orders will be quickly filled. It
covers PyQt for Qt 2.x and 3.x. PyKDE for KDE 2.x wasn't done when
I was writing the book.

-- 

Boudewijn Rempt  | http://www.valdyas.org 



More information about the Python-list mailing list