Converting an ugly path to a shell path

Jerry Hill malaclypse2 at
Tue Sep 14 01:37:08 CEST 2010

On Mon, Sep 13, 2010 at 7:07 PM,  <AmFreak at> wrote:
> 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 ?
seems to cover most of the possibilities.

Particularly, do you really need shell=True?  If not, you can just
call Popen([command, path], stdout=PIPE, stderr=PIPE) and not worry
about it.


More information about the Python-list mailing list