I want to add arg 1 to a range of numbers while generating in python:
for arg in sys.argv[1]:
for i in xrange(0,200000):
print "%s%05d"%(arg, i)
But this is not working...
I want argv[1] just be a number!
For example:
python script.py 012345
01234500000
01234500001
01234500002
.
.
.
argv[1]will just be number, how you will iterate over it. Because iteration is only possible over a sequence in python. And integer number is not a sequence.argv[1]may starts with0or not... but the point is sys.argv[1] must be only numberi, or do you want to append to (the string version of)i? Your first sentence says "I want to add ...", but your code shows "append". The reason is that if the former, your code can be quite different.0it won't show me because of int type...if I use str... so if I say0123ddas arg 1 it would also generating results for me...and this is not what I want