Nov-07-2022, 07:16 PM
i have a bunch of modules to import. their names are created by some code that uses a number in range(10,301) to make them. what is the most practical and pythonic way to do that? code might look like:
is there a way to do this on a host with no writable storage space?
for number in range(10,301): x = number * number * number z = (x+9999) % 1000 + 137 name = 'vmod' + str(z)[:3] from {name} import calc as {name} ... ... ...trouble is, the above code does not work as hoped because variable name does not get substituted.
is there a way to do this on a host with no writable storage space?