Format string with single quotes in it
contact at xavierho.com
Fri Sep 25 15:02:30 CEST 2009
On Fri, Sep 25, 2009 at 10:42 PM, Bahadir <bilgehan.balban at gmail.com> wrote:
> Hi there,
> My question is simple, but I've been spending some hours over the web
> and still struggling to get this right: How do I format a string that
> contains single quotes in it?
I don't know what you're doing wrong, but I've tried both Python 2.6.2 and
3.1.1, and the following worked perfectly for me:
>>> a = "Mrra%d 'Mrraa!!%d'"
>>> a %(1,2)
Maybe if you share a snippet of the code, or do more actual testing that
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list