[PyQt] QProcess: Seems to execute nothing
Phil Thompson
phil at riverbankcomputing.com
Sun Jan 30 18:02:41 GMT 2011
On Sun, 30 Jan 2011 18:55:49 +0100, Manuel Rotter
<rotter.manuel at gmail.com>
wrote:
> Hello all
>
> I'm trying to use QProcess to execute some commands, but it seems to do
> nothing.
>
> Here is my Code:
>
> http://python.pastebin.com/NKHaj1W4
> ---------------------------------
> p = QtCore.QProcess()
> #p.setStandardOutputFile(temp.name)
> p.start("sh -c 'echo lol > /home/naeg/lolfile'")
>
> p.close()
> ---------------------------------
>
> This file where I redirect to, doesn't even exist after executing that
> code.
>
> It doesn't work with setStandardOutputFile() either, and also not
> without "sh -c".
>
>
> I'm using Python 3.1.3 and pyQt 4.8.1(for Python 3, of course).
Read the docs for start() more carefully. The program name is "sh", not
the whole command line.
Phil
More information about the PyQt
mailing list