Код: Выделить всё
0 -82.871 2.52531 36.64 138 96.05
0 -76.1014 2.52577 35.36 137 83.9
0 -76.1869 5.57562 35.36 137 62.8
0 -18.1623 -11.6886 386.08 411 200.9
0 -4.62234 -4.91846 325.92 364 252.2
0 -2.52609 -1.63149 325.92 364 85.4
0 -2.52609 -1.63149 112.16 197 48.4
0 -18.1623 -4.91846 -54.24 67 69.55
0 -18.1623 -4.91846 386.08 411 64.55
12345678 1
12345678 2
2 25.2279 -72.3226 48.16 147 221.55
2 28.7109 -70.2263 48.16 147 1587.7
2 76.1009 -63.4562 46.88 146 110.35
2 31.9979 -65.5526 48.16 147 1601.8
2 35.4805 -63.4559 48.16 147 310.25
2 31.9979 -58.7826 49.44 148 492.8
2 35.4805 -56.6859 46.88 146 42.6
2 1.63117 -43.1461 73.76 167 54.55
2 4.91818 -38.4723 76.32 169 75.4
Код: Выделить всё
file = 'Runnumber169raw10.txt'
magic_number = '12345678'
event1 = []
x1 = []
y1 = []
z1 = []
tb1 = []
q1 = []
Xnoselection = []
X = []
distanceradius = 0
with open(file, 'r') as raw_dat:
line = raw_dat.readlines()[7:]
for lines in line:
lines.split()
print(lines)
if lines.split()[0] == magic_number:
break
Подробнее здесь: https://stackoverflow.com/questions/763 ... -value-and