Unable to write % character to a file using writelines() method

dudeja.rajat at gmail.com dudeja.rajat at gmail.com
Sun Sep 28 19:03:54 CEST 2008


On Sun, Sep 28, 2008 at 5:51 PM, Christian Heimes <lists at cheimes.de> wrote:

> dudeja.rajat at gmail.com wrote:
>
>> Hi,
>>
>>
>> I'm using the writelines() method to write some lines to a text file. But
>> I'm unable to write the % character to the file using the following
>> format:
>>
>> fdTolFile.writelines("\n\tdiff Not in %s '%' range" %(toleranceInPer))
>>
>
> Try %%  :)
>
> Christian
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>


Thanks Garry & Christian.

It worked.

Regards,
Rajat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080928/eff59085/attachment.html>


More information about the Python-list mailing list