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

Christian Heimes lists at cheimes.de
Sun Sep 28 12:51:20 EDT 2008


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




More information about the Python-list mailing list