Gabriel gave me the key to a fine solution, so just to put a bow tie on this thread:
#!/usr/bin/python import sys sys.path.extend (['../lib', '../bin']) from VLMLegacy.CardReader import CardReader rdr = CardReader ("../example/B767.dat","PRINTABLE") iotypes = ["WINGTL","VLMPC","VLM4997"] for iotype in iotypes: classname = "Conditions" __import__("VLMLegacy." + iotype + "." + classname) module = sys.modules[packagename] cls = getattr(module, classname) a = cls(rdr,2) a.test() Works like a champ! It would have taken days for me to find that by trial and error and rtfm and google. So thank you all. Even if at times I was rather unclear about what I was trying to accomplish. Now I can move on to parsing those pesky Fortran card images... There wouldn't happen to be a way to take n continguous slices from a string (card image) where each slice may be a different length would there? Fortran you know. No spaces between input fields. :-) I know a way to do it, iterating over a list of slice sizes, perhaps in a list comprehension, but some of the august python personages here no doubt know better ways.
signature.asc
Description: Digital signature
-- http://mail.python.org/mailman/listinfo/python-list