Background
Updated: Here is the horrendous list I'm working with (please excuse the list's false title). The length and data is subject to change because I'm retrieving this information from an ever-changing database.
Desired Outcome
I will further explain my purposes because I am unsure of the best way to go about this. Each number represents an ID as noted below. I need to create an XML file where Software elements have Target sub-elements based upon the SoftwareID and TargetID matching up in the tuple.
For example:
SoftwareID TargetID XML Representation
----------------------------------------------------------------------
65 115 <-- This Software element (id=65) has only one Target
sub-element (id=115)
138 218 <-- This Software element (id=138) will have multiple
138 219 Target sub-elements (ids=218, 219, 220)
138 220
Attempt
I've played with unpacking the sequence as done here, but the list is much too long for this implementation. I get an error that says Too many values to unpack.
I see now that this is actually a list of tuples instead of just a single tuple, so this wouldn't work anyway.
I've tried this implementation but get an error that says tuple object has no attribute 'split'.
As for the rest of my implementation, I am lost without being able to separate this stupid list.
Question
- How can I separate the data from this list of tuples in order to use it for the implementation described in the Desired Outcome section?