Hi Tiago,

try this:

# self.command = "program " + str(self.MyLineEdit.text())
# p_output = os.popen(self.command)

dada
On Monday 24 December 2007 04:24:07 Tiago Maluta wrote:
> Hi,
> In order to use a popen function, I need convert a QString in python
> string to use as argument.
>
> My code was:
>
>       # self.command = "program " + self.MyLineEdit.text()
>       # p_output = os.popen(self.command)
>
> And I got:
>       > TypeError: popen() argument 1 must be string, not QString
>
> because self.command is QString I tried change the type with ascii()
> method:
>
>       # self.command = "program " + self.MyLineEdit.text()
>       # p_output = os.popen(self.command.ascii())
>
> But I still got (another) error message:
>       > p_output = os.popen(self.command.ascii())
>       > AttributeError: ascii
>
> best regards,
>
> - tiago
> _______________________________________________
> PyQt mailing list    [email protected]
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt


_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to