[PyKDE] QString strangeness
shane richards
shanerich at email.com
Tue Sep 16 01:34:01 BST 2003
Just wondering how you keep an "=" sign in QString/QStringList, when passing
the list or string around?
I am trying to launch a command line program as a process, with
arguments sent in the form:
command -okey=arg1 -okey=arg2
(with no spaces inside the key/value pairs).
the following shows the idea - get a key/value and place
the "-o" switch and the "=" sign to form an argument:
...
keyval = QString(" -o%1=%2").arg(key).arg(val)
print ("%s" % (keyval)) # returns what I want
args.append(keyval)
...
proc = QProcess(self)
proc.setArguments(args)
...
But if I use 'ps ax' to view the running processes on my system, "=" sign will
have disappeared on the command line! It shall remain if I wrap it in spaces
ie.
keyval = QString(" -o%1 = %2").arg(key).arg(val)
But for some reason this plays havoc with the running process and eats all my
CPU!!!
I have noticed the same problem running programs from the 'tools' menu in
eric-3.x. Any "=" sign just disappears. Anyone have a solution?
shanerich
More information about the PyQt
mailing list