Em 13-01-2014 17:29, Peter Otten escreveu:
> Paulo da Silva wrote:
>
>> Em 13-01-2014 08:58, Peter Otten escreveu:
>
> I looked around in the stdlib and found shlex.quote(). It uses ' instead of
> " which simplifies things, and special-cases only ':
>
print(shlex.quote("alpha'beta"))
> 'a
Paulo da Silva wrote:
> Em 13-01-2014 08:58, Peter Otten escreveu:
>> Peter Otten wrote:
>>
>>> Paulo da Silva wrote:
>>>
Em 12-01-2014 20:29, Peter Otten escreveu:
> Paulo da Silva wrote:
>
>>> but I have not tried it myself. Also, some bytes may need to be
>>> escaped, eith
Em 13-01-2014 08:58, Peter Otten escreveu:
> Peter Otten wrote:
>
>> Paulo da Silva wrote:
>>
>>> Em 12-01-2014 20:29, Peter Otten escreveu:
Paulo da Silva wrote:
>> but I have not tried it myself. Also, some bytes may need to be
>> escaped, either to be understood by the shell,
Peter Otten wrote:
> Paulo da Silva wrote:
>
>> Em 12-01-2014 20:29, Peter Otten escreveu:
>>> Paulo da Silva wrote:
>>>
> but I have not tried it myself. Also, some bytes may need to be
> escaped, either to be understood by the shell, or to address security
> concerns:
>
>>
Paulo da Silva wrote:
> Em 12-01-2014 20:29, Peter Otten escreveu:
>> Paulo da Silva wrote:
>>
but I have not tried it myself. Also, some bytes may need to be
escaped, either to be understood by the shell, or to address security
concerns:
>>>
>>> Since I am puting the file nam
Em 12-01-2014 20:29, Peter Otten escreveu:
> Paulo da Silva wrote:
>
>>> but I have not tried it myself. Also, some bytes may need to be escaped,
>>> either to be understood by the shell, or to address security concerns:
>>>
>>
>> Since I am puting the file names between "", the only char that nee
Paulo da Silva wrote:
>> but I have not tried it myself. Also, some bytes may need to be escaped,
>> either to be understood by the shell, or to address security concerns:
>>
>
> Since I am puting the file names between "", the only char that needs to
> be escaped is the " itself.
What about the
>
> I think instead of the hard way sketched out above it will be sufficient to
> specify the error handler when opening the destination file
>
> shf = open(bashfilename, 'w', errors="surrogateescape")
This seems to fix everything!
I tried with a small test set and it worked.
>
> but I have no
Paulo da Silva wrote:
> Em 12-01-2014 16:23, Peter Otten escreveu:
>> Paulo da Silva wrote:
>>
>>> I am using a python3 script to produce a bash script from lots of
>>> filenames got using os.walk.
>>>
>>> I have a template string for each bash command in which I replace a
>>> special string with
Em 12-01-2014 16:23, Peter Otten escreveu:
> Paulo da Silva wrote:
>
>> I am using a python3 script to produce a bash script from lots of
>> filenames got using os.walk.
>>
>> I have a template string for each bash command in which I replace a
>> special string with the filename and then write the
On 01/12/2014 07:36 AM, Paulo da Silva wrote:
Hi!
I am using a python3 script to produce a bash script from lots of
filenames got using os.walk.
I have a template string for each bash command in which I replace a
special string with the filename and then write the command to the bash
script fil
Paulo da Silva wrote:
> I am using a python3 script to produce a bash script from lots of
> filenames got using os.walk.
>
> I have a template string for each bash command in which I replace a
> special string with the filename and then write the command to the bash
> script file.
>
> Something
On Sun, 1/12/14, Paulo da Silva wrote:
Subject: Problem writing some strings (UnicodeEncodeError)
To: python-list@python.org
Date: Sunday, January 12, 2014, 4:36 PM
Hi!
I am using a python3 script to produce a bash script from
lots of
filena
13 matches
Mail list logo