Guest User

nums.py

a guest
May 15th, 2014
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. from sys import stdin, stdout
  2.  
  3. value = None
  4. for line in stdin:
  5.     if line.startswith("t="):
  6.         value = int(line[2:]) / 1000.0
  7.         break
  8. if value:
  9.     stdout.write("{0},\n".format(value))
  10.  
  11. # On linux: "cat foo|python nums.py >>data.csv"
  12. # On windows: "type foo.txt|python nums.py >>data.csv"
Advertisement
Add Comment
Please, Sign In to add comment