If I do something like this:
print "%08d" % 2
It will print '00000002'. However, I want to change the "8" to a "3" at runtime (to get '002' instead). I tried this:
MyLength = 3
print "%0" + str(MyLength) + "d" % 2
but I get: "TypeError: not all arguments converted during string formatting"
Can anyone see what's wrong with that?
Thanks,
Dave