Are there sprintf in Python???

rzed rzantow at gmail.com
Mon Jan 22 15:08:25 EST 2007


"questions?" <universal_used at hotmail.com> wrote in
news:1169496238.925052.311660 at l53g2000cwa.googlegroups.com: 

> Are there any sprintf in Python?
> I know you can print to files(or redefine sys.stout) and later
> open the file content.
> 
> Are there similar function to sprintf in C?

Something like this?

x = 9
vbl = "One digit: %d, four digits: %04d" % (x,x)
print vbl



More information about the Python-list mailing list