use var to form name of object

Bruno Desthuilliers onurb at xiludom.gro
Wed Jul 5 05:32:40 EDT 2006


gel wrote:
> gel wrote:
> 
> 
>>Hi
>>I would like to pass a variable in and use it as part of a name of an
>>object, something like below, where I pass the variable software into
>>the function and use it as part of the name of the object so that I can
>>append to it using the other vairables.  Any suggestions?
>>
>>
>>    def a_d(self,software,mac,time,extra):
>>        global d_software
>>        d_software.software.append([mac,time,extra])
> 
> 
> I sorted it out
> 
Then do a favour to other persons facing the same problem : share your
solution. As a side effect, you'll also have your code checked by lot of
confirmed Python programmer !-)

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list