Skip to content

Instantly share code, notes, and snippets.

@jasongallant
Created May 7, 2013 01:17
Show Gist options
  • Save jasongallant/5529617 to your computer and use it in GitHub Desktop.
Save jasongallant/5529617 to your computer and use it in GitHub Desktop.
Python: Calculate Distances
#!/usr/bin/env python
import sys
inputfile = sys.argv[1]
with open(inputfile) as fd:
next(fd)
for line in fd:
columns=line.split()
#print columns
columns=map(float,columns[1:5])
#print columns
#print columns[1],columns[0]
print "%s \t %s" % (columns[1] - columns[0], columns[3])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment