I am new to python so I am trying to figure out how to use a generator expression with tuples of integers.
I have the following construct:
Number of Polygons: 3
Blocked Polygons:
{
0:(6, 192, 365, 172, 388, 115, 378, 127, 311, 142, 305, 192, 334),
1:(4, 172, 688, 115, 678, 105, 650, 107, 634),
2:(6, 242, 294, 215, 278, 205, 250, 242, 205, 284, 221, 292, 234)
}
Where Blocked Polygons is a dictionary object
the first item 6, 192, 365...etc..
where 6 is the number of coordinates in that list.
What I want to convert it to is a dictionary of coordinate dictionaries that looks like this:
{
0:{
0:(192, 365),
1:(172, 388),
2:(115, 378),
3:(127, 311),
4:(142, 305),
5:(192, 334)
},
}, etc...
any ideas on how to do this effectively?