Problem writing some strings (UnicodeEncodeError)

Paulo da Silva p_s_d_a_s_i_l_v_a at netcabo.pt
Mon Jan 13 13:44:01 EST 2014


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"))
> 'alpha'"'"'beta'
> 
> So the answer is simpler than I had expected.
> 
Yes, it should work, at least in this case.
Although python oriented, it seems to work to bash also.
I need to remove the "" from the templates and use shlex.quote for
filenames. I'll give it a try.

Thanks




More information about the Python-list mailing list