Use:
for i in range(0,150):
print("echo update \necho snapshot \necho gall \necho clearobj")
print("echo read rot_"+"%03d"%i+".speck \n")
"%03d"%a
in Python2 converts to a three digit string.
1
solved duplicate individual paragraphs in txt file