public
Created

  • Download Gist
tycho-count.py
Python
1 2 3 4 5 6 7 8
with open("tyc_main.dat", mode="rt") as tycho_database:
num_close = 0
for line in tycho_database:
plx = line[79:86].strip()
if line[267] != 'P' and plx and float(plx) > 200 and line[349] != 'K' and int(line[260]) <= 4:
num_close += 1
 
print(num_close)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.