Re: Converting an ugly path to a shell path

2010-09-14 Thread Nobody
On Tue, 14 Sep 2010 01:07:48 +0200, AmFreak wrote: > 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 wh

Re: Converting an ugly path to a shell path

2010-09-14 Thread Lawrence D'Oliveiro
In message , amfr...@web.de wrote: > The shell don't understand the special chars so i have to escape them with > "\" . > Is there a function that does this ? You could get the shell (at least if it’s Bash) itself to do this. Try the following script: import sys import os import sub

Re: Converting an ugly path to a shell path

2010-09-13 Thread Jerry Hill
On Mon, Sep 13, 2010 at 7:07 PM, 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/questi

Converting an ugly path to a shell path

2010-09-13 Thread AmFreak
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/