fprintf(): Python Equivalent????

Aahz Maruch aahz at panix.com
Mon Jun 18 21:45:52 EDT 2001


In article <e56d8da7.0106181658.6d21b08f at posting.google.com>,
Prem Rachakonda <prem at engr.uky.edu> wrote:
>
>  Does python have some function which does a formatted file writing
>functionality similar to C's
>
>fprintf(fp,"%s %s",string1, string2);

Use the "%" operator:

"%s %s" % (string1, string2)
-- 
                      --- Aahz  <*>  (Copyright 2001 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

"It's not what you know, it's what you *think* you know."  --Steve Martin



More information about the Python-list mailing list