pointer and python

  • Thread starter Mohsen Pahlevanzadeh
  • Start date
M

Mohsen Pahlevanzadeh

Dear all,

Suppose I have the following code:
##########################################3
mydic = dict()
mydict.update({'string':QtGui.QCheckBox()}) ## suppose this dic has many
value with some string and QCheckBox Object

#####Then i have itreate it :

for key, val in mydict.items():
setattr(self,"%s" % val,XXX) ###===> this line is the given line
getattr(self,"%s" % val)

############################################33
According to the above code, i fetch a set of object from dict and set
them as attribute, But question is , val has value and it's important,
and i can't replace any other value with it, What i replace with XXX in
setattr ?

Yours,
Mohsen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,692
Latest member
JenniferTi

Latest Threads

Top