Polymoprhism question

RVic rvince99 at gmail.com
Fri May 24 07:40:22 EDT 2013


I'm trying to figure out (or find an example) of polymorphism whereby I pass a commandline argument (a string) which comports to a class (in java, you would say that it comports to a given interface bu I don't know if there is such a thing in Python) then that class of that name, somehow gets intantiated from that string. This way, I can have similar classes, but have my program use various ones by simply changing the commandline argument.

Can anyone show me how this might be done in Python? Thanks.

-RVic



More information about the Python-list mailing list