Skip to content

Instantly share code, notes, and snippets.

@Muon
Created June 11, 2012 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Muon/2912916 to your computer and use it in GitHub Desktop.
Save Muon/2912916 to your computer and use it in GitHub Desktop.
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment