> -----Original Message-----
> From: pyqt-boun...@riverbankcomputing.com [mailto:pyqt-
> boun...@riverbankcomputing.com] On Behalf Of amfr...@web.de
> Sent: September-13-10 11:19 AM
> To: pyqt@riverbankcomputing.com
> Subject: [PyQt] Converting an ugly path to a shell path
>
> Hi,
>
> im using a QFileDialog to let the user select a path that is used later
in
> a command send to the shell like this:
>
> retcode = Popen(command + " " + path, shell=True, stdout = PIPE, stderr
=
> PIPE)
>
> The problem that occurs now is when the user selects an "ugly" path like
> this /home/user/!" §$/.
> The shell don't understand the special chars so i have to escape them
with
> "\" .
> Is there a function that does this ?

Try, from the os module, os.path.abspath.

Darryl
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to