[PyQt] kdecore.KProcess.Communication enum not OR-able

Wilbert Berendsen wbsoft at xs4all.nl
Sat Apr 12 14:04:48 BST 2008


The KDE docs say that you can OR the values of the 
kdecore.KProcess.Communication enum when start()ing a KProcess.[1]

However that seems not to be possible:
>>> from kdecore import *
>>> p=KProcess()
>>> p.setExecutable('cat')
>>> p.start(KProcess.NotifyOnExit, KProcess.Stdin | KProcess.Stdout)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: argument 2 of KProcess.start() has an invalid type
>>> type(KProcess.Stdin | KProcess.Stdout)
<type 'int'>
>>> type(KProcess.Stdin)
<class 'kdecore.Communication'>

So I can only use the predefined values of the Communication enum (All, 
AllOuput etc.). Is this a bug and is there a workaround to start a KProcess() 
and only communicate with stdout and stdin and not stderr?


w best regards,
Wilbert Berendsen

"You must be the change you wish to see in the world."
        -- Mahatma Gandhi

More information about the PyQt mailing list