On Mon, Sep 13, 2010 at 7:07 PM, <amfr...@web.de> 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 ?
http://stackoverflow.com/questions/35817/whats-the-best-way-to-escape-ossystem-calls-in-python 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. -- Jerry -- http://mail.python.org/mailman/listinfo/python-list