Mercurial Hosting > traffic-intelligence
diff python/utils.py @ 42:1a2ac2d4f53a
added loading of the rest of the data for objects
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Thu, 01 Jul 2010 10:44:32 -0400 |
parents | 8cafee54466f |
children | 74d2de078baf |
line wrap: on
line diff
--- a/python/utils.py Fri May 28 20:25:45 2010 -0400 +++ b/python/utils.py Thu Jul 01 10:44:32 2010 -0400 @@ -176,6 +176,13 @@ tmp = array(poly.exterior) plot(tmp[:,0], tmp[:,1], options) +def line2Floats(l, separator=' '): + '''Returns the list of floats corresponding to the string''' + return [float(x) for x in l.split(separator)] + +def line2Ints(l, separator=' '): + '''Returns the list of ints corresponding to the string''' + return [int(x) for x in l.split(separator)] ######################### # running tests