Create object for item in list

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Helge

    Create object for item in list

    I wonder how this can be accomplished:

    I've got a list, containing several strings. The strings look like
    this:

    [ "Name1/N1/N2/N3" , "Name2/N1/N2/N3" , "..." ]

    I would like to create one object for each item in the list, and the
    name of the object should be "str(item.split ("/")[0])".

    I've tried this, but it won't work:

    for item in list:
    str(item.split( "/")[0]) = class(item)

    ....
Working...