0

I would like to generate instances from a class with a variable.

I am opening and reading a text file, and I would like to generate an instance every time I find a special text. So if I find the 'Wall' word, I like to make an instance which will be, Wall01 and then for the second time Wall02 and so forth.

class ifc_wall(object):
    ...

list = [23,45,67,98] #these should be the wall numbers
for wall_number in list:
    ("string: WALL" + wall_number) = ifc_wall(wall_number) #???

I am having a hard time with ??? part, and couldn't find a solution on the forums. And I would like to use basic python code without any imported stuff. Thanks a lot!

0 Answers0