Hi all I have this part of code:
for line in response.body.split("
"):
if line != "":
opg = int(line.split(" ")[2])
opc = int(line.split(" ")[3])
value = int(line.split(" ")[5])
if opg==160 & opc==129:
ret['success'] = "valore: %s" % (value)
self.write(tornado.escape.json_encode(ret))
I have a series of line of type
1362581670 2459546910990453036 156 0 30 0
I want to take only the line where the third and fourth element is respectively 160 and 129.
This code doesn't work. Do I have to do some casting? I think opg==160 is working to compare int with int...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…