Python Forum
Is it possible to loop through class attributes via string?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is it possible to loop through class attributes via string?
#4
Completely misunderstood the syntax of getAttr. Issue resolved
getattr(self, "PoseSlot_1").setIcon(QtGui.QIcon(self.jsonFolderPath + "/icon/" + self.jsonTemplateData.values()[0][0]["icon"]))
Reply


Messages In This Thread
RE: Is it possible to loop through class attributes via string? - by 04chiak - Feb-04-2018, 09:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question [solved] Classes, assign an attributes to a class not to instances.. SpongeB0B 4 958 May-20-2023, 04:08 PM
Last Post: SpongeB0B
  PyRun_SimpleFile calling multiprocessing Python Class cause endless init loop Xeno 2 1,056 Sep-19-2022, 02:32 AM
Last Post: Xeno
  Loop through a list of string oldtrafford 4 1,487 Mar-24-2022, 05:30 PM
Last Post: deanhystad
  [Solved] Novice question to OOP: can a method of class A access attributes of class B BigMan 1 1,324 Mar-14-2022, 11:21 PM
Last Post: deanhystad
  Distinguishing different types of class attributes Drone4four 4 2,117 Feb-21-2022, 06:34 PM
Last Post: deanhystad
  Loop through a list of string oldtrafford 3 1,718 Feb-15-2022, 04:42 PM
Last Post: snippsat
  loop for dynamic cut string - cleaner way? korenron 4 1,961 Nov-22-2021, 02:30 PM
Last Post: korenron
  I am trying to reverse a string using loop codinglearner 4 2,188 Sep-28-2021, 10:46 PM
Last Post: Pedroski55
  Calls to Attributes of a Class SKarimi 3 3,410 Apr-22-2021, 04:18 PM
Last Post: SKarimi
  Convert string to JSON using a for loop PG_Breizh 3 2,988 Jan-08-2021, 06:10 PM
Last Post: PG_Breizh

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020