I'm trying to name variables using elements of a list.
I have 3 companies named absoft, dataco, microm.
In my script I have some methods defined for those like this one:
copyfile(absoft_old_file, absoft_copy)
copyfile(dataco_old_file, dataco_copy)
copyfile(microm_old_file, microm_copy)
Is it possible to loop those names from a list instead? It's very simple for strings, but for variable names I didn't figure out how to do that yet.
company_list = [absoft, dataco, microm]
for company in company_list:
copyfile(company + _old_file, company + _copy)
Please help