Sorting two hashes into one in Python
I have two hash FP['NetC'] containing all cells connected to a specific
net and FP['CellD_NM']containing the x1,x0 coordinate for each cell.
I need to create a new hash witch uses the nets from hash FP['NetC'] as
keys and for each key gives its x1,x0 from hash FP['CellD_NM'].
Here is my code
L1={}
L0={}
for net in FP['NetC']:
for cell in FP['NetC'][net]:
x1=FP['CellD_NM'][cell]['X1']
x0=FP['CellD_NM'][cell]['X0']
L1[net]=x1
L0[net]=x0
print L1
print L0
All I got was the last value for each net.
Do you have eny ideas?
Thanks.
No comments:
Post a Comment