Re: Converting String to Class

2004-12-01 Thread Matt Gerrans
You didn't specify exactly how the string is parsed, so this is a guess: class Thingy(object): def __init__(self,rawinfo): self.StructId, vq,self.ProcessName = rawinfo.split() self.Version,self.QName = vq.split('.') def __str__(self): return '' % (self.StructId, self.Versio

Converting String to Class

2004-12-01 Thread michael
Hello, I have a script that is called by the shell this way : mqtrigger.py "TMC2TEST.QUEUE LV1871.MQPROCESS" So argv[1] is the string "TMC2TEST.QUEUE LV1871.MQPROCESS" I would like to construct a class with that string that contains the attributes -StrucId -VersionId -QName -Pr