I am doing the simulation for different combinations of material properties (i, j, m) iteratively. So I am trying to create the job names Job1, Job2, Job3,......till the end of the loop. But my current code creates the job name as Job1 and again and again as Job1. Because of that, the files are overwritten.Problem Screenshot
for i in arange(1, 3, 1):
for j in arange(0.35, 0.36, 0.02):
for m in arange(1.67e-08, 1.68e-08, 2e-10):
# k - i 100 - , l - j 100, n - m 1e8
i_ = int()
j_ = (i_+1)
# Create job name based on loop values
job_name = 'Job%d' % (j_)
Python uses names, so you don't need to declare types like this
Just drop naming _i = int()
(which becomes 0
) and use i
directly
>>> a = int()
>>> a
0
for i in arange(1, 3, 1):
for j in arange(0.35, 0.36, 0.02):
for m in arange(1.67e-08, 1.68e-08, 2e-10):
# k - i 100 - , l - j 100, n - m 1e8
# Create job name based on loop values
job_name = "Job{}".format(i+1)