Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #57001 > unrolled thread
| Started by | Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> |
|---|---|
| First post | 2013-10-18 02:47 +0330 |
| Last post | 2013-10-18 02:47 +0330 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
pointer and python Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> - 2013-10-18 02:47 +0330
| From | Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> |
|---|---|
| Date | 2013-10-18 02:47 +0330 |
| Subject | pointer and python |
| Message-ID | <mailman.1187.1382051885.18130.python-list@python.org> |
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
Back to top | Article view | comp.lang.python
csiph-web