[PyQt] Converting an ugly path to a shell path

Sybren A. Stüvel sybren at stuvel.eu
Tue Sep 14 07:08:22 BST 2010


On Tuesday 14 September 2010 00:08:40 AmFreak at web.de wrote:
> I think quotes don't work always ?
> For example when i have a dir like ""' how do i quote it ?

I would take out the middle man. Don't use the shell, unless you 
really have to. If you just pass a list of arguments to 
subprocess.Popen, they will be "received" by the application just as-
is. No escaping needed.

import subprocess
proc = subprocess.Popen([command, path])

-- 
Sybren A. Stüvel

sybren at stuvel.eu
http://stuvel.eu/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100914/19354d3d/attachment.pgp>


More information about the PyQt mailing list