i have a problem and cant find an answer inside the Forum so i hope someone will be able to help me because it seams i cant figure it aout by myself :)
def loadData(uid):
// ...
return [uid,u'',u'',u'',u'',u'',u'',u'',u'',]
evts = []
uids = [7, 43,]
for uid in uids:
evts.append(loadData(uid))
tmpdata = [[None] * len(evts)] * len(evts[0])
print tmpdata
for iKey in range(len(tmpdata)):
for iEvt in range(len(tmpdata[iKey])):
tmpdata[iKey][iEvt] = evts[iEvt][iKey]
print iKey, iEvt, tmpdata[iKey]
print tmpdata
Normaly i want to create a list with each attribute inside athe sub list, so for example the 0,0 and 0,1 index had to be the uid values of each data (7& 43) but as you see here it does not work as wanted....
result:
[[None, None], [None, None], [None, None], [None, None], [None, None], [None, None], [None, None], [None, None],
[None, None], [None, None], [None, None], [None, None], [None, None], [None, None], [None, None], [None, None],
[None, None], [None, None], [None, None], [None, None], [None, None], [None, None], [None, None], [None, None],
[None, None], [None, None], [None, None], [None, None], [None, None], [None, None]]
0
0[7, None]
0
1[7, 43]
1
0[u'Matthias Reim & Band', 43]
1
1[u'Matthias Reim & Band', u'Der Nussknacker']
...
[[None, None], [None, None], [None, None], [None, None], [None, None], [None, None], [None, None], [None, None],
[None, None], [None, None], [None, None], [None, None], [None, None], [None, None], [None, None], [None, None],
[None, None], [None, None], [None, None], [None, None], [None, None], [None, None], [None, None], [None, None],
[None, None], [None, None], [None, None], [None, None], [None, None], [None, None]]
i want a result like:
[[7, 43], [u'Matthias Reim & Band', u'Der Nussknacker'], ...]