f = open('transaction.log','r')
ClerkHash = dict()
arr = [0,0]
for line in f:
Tdate = line[0:12]
AccountKey = line[12:50]
TransType = line[22:2]
ClerkKey = line[24:10]
CurrencyCode = line[34:2]
Amount = line[36:45]
print line
print '\n'
print AccountKey
print '\n'
print Tdate print '\n'
if TransType=="04":
ClerkHash[ClerkKey+AccountKey] = arr; // is this line corrent ? i don't want to corrupt the array every time ? how should i do it ?
ClerkHash[ClerkKey+AccountKey][0]+=1
ClerkHash[ClerkKey+AccountKey][1]+= Amount
for Key in ClerkHash.keys():
if ClerkHash[key][0] >= 3 and ClerkHash[key][1] > 1000:
print Key
我想要一个哈希名ClerkHash[ClerkKey+AccountKey] 它由2 int数组组成:第一个索引是drawl num,第二个索引是amount 我定义好数组和散列了吗? 另外,我想把弹药加起来……我怎么能做到呢?在
检查你的切片间隔!第二个参数是另一个索引,而不是从第一个索引执行的步骤数。我想是吧
应该是的
^{pr2}$如果设置了
每次遇到
TransType == "04"
。所以改变到
到目前为止,我看到的问题很少
应该是
^{pr2}$以及
应该是
相关问题 更多 >
编程相关推荐