fprintf(): Python Equivalent????

Neil Schemenauer nas at python.ca
Mon Jun 18 21:24:56 EDT 2001


Prem Rachakonda wrote:
> HI,
>   Does python have some function which does a formatted file writing
> functionality similar to C's
> 
> fprintf(fp,"%s %s",string1, string2);

fp.write("%s %s" % (string1, string2))

The '%' operator is more like sprintf though.

  Neil




More information about the Python-list mailing list