Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating Dynamic Objects
#5
Well I guess that's the problem...I have no idea how to go about it. Here's the theory:
fields = ['test','test','ing']
#where fields can be any anything, any number, any text, these are just place holders as an example
from namedlist import namedlist
Sns = namedlist('Sns',for f in fields:[f], default=None)
Reply


Messages In This Thread
Creating Dynamic Objects - by MacFie - Jun-11-2019, 06:17 PM
RE: Creating Dynamic Objects - by Gribouillis - Jun-11-2019, 07:16 PM
RE: Creating Dynamic Objects - by MacFie - Jun-11-2019, 08:20 PM
RE: Creating Dynamic Objects - by Gribouillis - Jun-11-2019, 08:35 PM
RE: Creating Dynamic Objects - by MacFie - Jun-13-2019, 02:48 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need help with creating dynamic columns with for loops for stock prices PaDat 2 896 Feb-22-2023, 04:34 AM
Last Post: PaDat
  Creating list of lists, with objects from lists sgrinderud 7 1,612 Oct-01-2022, 07:15 PM
Last Post: Skaperen
  Creating a loop with dynamic variables instead of hardcoded values FugaziRocks 3 1,482 Jul-27-2022, 08:50 PM
Last Post: rob101
  error creating new object after loading pickled objects from file arogers 2 3,419 Feb-02-2019, 10:43 AM
Last Post: Larz60+
  Creating a list of class objects hjuyrfc 2 3,060 Jul-22-2017, 07:41 PM
Last Post: hjuyrfc
  Creating Dynamic Variable Names Dragonexpert 3 8,131 Oct-22-2016, 02:17 PM
Last Post: Dragonexpert

Forum Jump:

User Panel Messages

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