[PyQt] Working with os.popen and qprogressdialog

JMiahMan jmiahman at gmail.com
Sun Mar 9 06:04:57 GMT 2008

I need to create a progress bar for a command that I run with popen, but so
far I've had no luck. Here's a sniplet of code:

Pd = QtGui.QProgressDialog ( "Creating Disk Image...", "Stop", 0, 0, self)
	Pd.show ()
	from os.path import isdir
	if isdir(self.foldername):
		changessize = self.ui.CHNGLcd.intValue()
		changesname = self.ui.CHNGName.text()
		os.popen("dd if=/dev/zero of="+str(self.foldername)+"/"+str(changesname)+"
bs=1M count="+str(changessize)+"; sleep 5; echo 'y' | mkfs.ext3 

I just want the progress bar to show up and bounce back on forth while this
process is running but I've only gotten it at best to show up afterwards.
View this message in context: http://www.nabble.com/Working-with-os.popen-and-qprogressdialog-tp15924148p15924148.html
Sent from the PyQt mailing list archive at Nabble.com.

More information about the PyQt mailing list