import re
import numpy as np
infile = "shapes.txt"
filt = re.compile(r'^"?([^"]*)"?$')
converter = lambda x: filt.match(x.strip()).group(1)
data = np.recfromcsv(infile, delimiter=',')
shapes = np.array(map(int, [converter(x) for x in data["shape_id"]]))
lats = np.array(map(float, [converter(x) for x in data["shape_pt_lat"]]))
lons = np.array(map(float, [converter(x) for x in data["shape_pt_lon"]]))
idx = np.where(shapes == 10003553)
print "{%s:" % (10003553),
for la,lon in zip(lats[idx], lons[idx]): print "[%f,%f]," % (la,lon),
print "}"

#import matplotlib.pyplot as plt
#idx = np.where(shapes == 10003553)
#plt.plot(lats[idx], lons[idx])
#plt.show()
@@ -2,16 +2,21 @@
 mport re
+, sys
 %0Aimport 
@@ -40,20 +40,19 @@
 e = 
-%22shapes.txt%22
+sys.argv%5B1%5D
 %0Afil
@@ -428,45 +428,59 @@
  == 
-10003553)%0Aprint %22%7B%25s:%22 %25 (10003553
+41545540)%5B0%5D%0A%0Aif 0:%0A%09print '%7B%22%25s%22:' %25 (41545540
 ),%0A
+%09
 for 
@@ -545,16 +545,17 @@
 a,lon),%0A
+%09
 print %22%7D
@@ -560,117 +560,178 @@
 %22%7D%22%0A
-%0A#import matplotlib.pyplot as plt%0A#idx = np.where(shapes == 10003553)%0A#plt.plot(lats%5Bidx%5D, lon
+else:%0A%09print %22%5B%22%0A%09for i in idx:%0A%09%09print %22%7B%22%0A%09%09print '    name: %22pt%25d%22,' %25 (i)%0A%09%09print '    lng: %25f,' %25 (lons%5Bi%5D)%0A%09%09print '    lat: %25f,' %25 (lat
 s%5Bi
-dx
 %5D)%0A
-#plt.show()
+%09%09print ' %7D, ',%0A%09print %22%5D%22

Print out an array of points