how to add object from dict
Mohsen Pahlevanzadeh
mohsen at pahlevanzadeh.org
Wed Oct 16 20:08:52 EDT 2013
On Thu, 2013-10-17 at 10:45 +1100, Ben Finney wrote:
> Mohsen Pahlevanzadeh <mohsen at pahlevanzadeh.org> writes:
>
> > and another file,(projectsFind.py) i have the following code:
> > #################################################################3
> > for key, val in
> > self.projectsInstance.addOnFieldsInstance.items():
> > instance = getattr(self,"%s" % val)
> > print val
> > #QtCore.QObject.connect(instance,
> > QtCore.SIGNAL(_fromUtf8("stateChanged (int)")),
> > #lambda:
> > self.projectsInstance.setFilterDict_Find("TWCH",self,"addonfields",instance.CheckState(),instance))
> > ######################################################################3
>
> The above code has been mangled, and the indentation isn't correct. I
> don't want to guess what it was originally; better that you find a user
> agent which won't wrap your code lines.
>
> The code is also difficult to read because it's got a lot of
> camelCaseNames and it's hard to see what the intent is. (I'd advise
> improving the code to conform to PEP 8, which will make your code easier
> to discuss with the Python community.)
>
> Lastly, it's not complete: we can't run it to see what you're seeing.
>
> Please re-work (or create) a short, self-contained, complete example
> that shows the behaviour <URL:http://sscce.org/>.
>
> --
> \ “Wrinkles should merely indicate where smiles have been.” —Mark |
> `\ Twain, _Following the Equator_ |
> _o__) |
> Ben Finney
>
Thank you for your useful link , i paste my code into :
http://www.heypasteit.com/clip/1008
More information about the Python-list
mailing list