12th Mar 2010

Setattr question

hi,

if tried this:

varname = 'myvar'
varvalue = 'myval'
setattr(self, varname, varvalue)


this seems to work; when i print self.myvar it outputs myval. when i try to use it for other things like self.addcontrol(self.myvar) it outputs this error:

traceback (most recent call last):
*file "c:\documents and settings\wyseterm\desktop\tvg\tvg.py", line 302, in ?
* *gids = tvguide()
*file "c:\documents and settings\wyseterm\desktop\tvg\tvg.py", line 101, in
* *self.addcontrol(self.vandaag0)
*file "c:\python24\lib\xbmcgui.py", line 115, in addcontrol
* *control.create(self)
attributeerror: 'str' object has no attribute 'create'

any idea how to get around it? what i wanted was a use a list to add controls for the xbmcgui but i don't seem to get it to work. anyone else ever did this, adding controls from lists?

any help/hint is really appreciated.

tia,
cheers
cactus




#If you have any other info about this subject , Please add it free.#
Your name:
E-mail:
Telphone:

Your comments:


If you have any other info about Setattr question , Please add it free.

Posted by smith under toyotataa.com |


RSS