escaping/encoding/formatting in python

Serhiy Storchaka storchaka at gmail.com
Fri Apr 6 09:49:57 EDT 2012


06.04.12 16:22, rusi написав(ла):
> Yes. I hand it to you that I missed the case of explicitly unbalanced
> strings.
> But are not such cases rare?

No, unfortunately. }:-(

> For example code such as:
> print '"'
> print str(something)
> print '"'
>
> could better be written as
> print '"%s"' % str(something)

Don't forget to escape %.




More information about the Python-list mailing list