[PyQt] QProcess Persistence

Phil Thompson phil at riverbankcomputing.com
Thu Oct 27 18:28:09 BST 2011


On Thu, 27 Oct 2011 21:00:45 +0800, Dominic Drane
<dom at reality-debug.co.uk>
wrote:
> I'm having problems with QProcess, I'd like to rlogin into a machine at
the
> start of the process and then write commands into stdin but as soon as I
> call the following (I'm on a linux box):
> 
> from PyQt4 import QtGui, QtCore
> 
> class TestWindow(QtGui.QDialog):
> 
> def __init__(self):
> 
> QtGui.QDialog.__init__(self)
> 
> proc = QtCore.QProcess()
> 
> proc.start("rlogin membrane")
> 
> proc.write("ooffice")
> 
> win = TestWindow()
> win.show()
> 
> The process.write() method doesn't appear to be called. Any ideas?
> 
> Thanks

Make sure you keep a reference to the QProcess instance.

Phil


More information about the PyQt mailing list