[PyKDE] Re: How to use "kdialog"

Russell Valentine russ at coldstonelabs.org
Wed Sep 22 22:56:55 BST 2004


Thorsten Kampe said the following on 09/22/04 06:56:
  > So the different kdialog options refer to single PyKDE classes?
> "--password" to KPassword? So, I think I'll stick with os.system().

If that is all you want, then it would be a good idea. I've used kdialog 
for just a progressbar from a script before.

> 
> But if someone could provide me with Python pseudocode that would 
> achieve the same thing as '"kdialog --msgbox "Hello world"' or 
> '"kdialog --password "Enter password"' I'd be grateful. It doesn't 
> have to be "working code". I just need the structure to "get the 
> picture" and teach myself the rest.

Maybe something like below, but this acts like a dialog before the main 
application starts up.


import sys
from kdecore import KApplication, KAboutData, KCmdLineArgs
from kdeui import KMainWindow, KMessageBox

about = KAboutData("msgbox", "msgbox", "1")
KCmdLineArgs.init(sys.argv, about)
app = KApplication()
win = KMainWindow()
KMessageBox.information(win, "Hello World")
win.show()
app.exec_loop()



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20040922/763938fd/signature.bin


More information about the PyQt mailing list