I would like to create a string buffer to do lots of processing, format and finally write the buffer in a text file using a C-style sprintf functionality in Pyt
sprintf
Use the formatting operator % : buf = "A = %d\n , B= %s\n" % (a, b) print >>f, buf