How can I format the string according to its length at runtime?

ed_tsang at yahoo.com ed_tsang at yahoo.com
Tue Jun 19 18:04:05 EDT 2001


I am trying to supply the precision formating at run time:

s = 123
print '(0x%-6X -)'%s

where I try to dynamically supply the number 6 from (6- length of s), 
I can't find a way to dynamically supply that. 

Anyone hav any idea?
Thanks





More information about the Python-list mailing list