I can't find the answer anywhere.
I have a class called "vrf".
I have an input file.
As Python iterates through the lines of this input file, every time it sees the word vrf, I want to create an object named after the next word.
So if it reading the line "ip vrf TESTER", I would like to dynamically create an object named TESTER of type vrf.
TESTER = vrf()
How in the world do I do this?
I've tried:
line.split()[2] = vrf()
Doesn't work.
globals()[line.split()[2]] = vrf(), but the dict solution is better, as it is not sane to modifyglobals(orlocals) directly.