Guest User

Untitled

a guest
Jun 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. #!/usr/bin/python
  2. # Filename: gpsget_ver1.py
  3.  
  4. import os
  5. import time
  6.  
  7. source = "/dev/ttyUSB0"
  8.  
  9. target_dir = "tmp/gps/"
  10.  
  11. target = target_dir + time.strftime('%Y-%m-%d-%H%M%S') + '.gpx'
  12.  
  13. gpsbabel_command = "gpsbabel -t -r -w -i m241 -f %s -o gpx -F %s" % (source, target)
  14.  
  15. print os.system(gpsbabel_command)
  16.  
  17. if os.system(gpsbabel_command) == 0:
  18.     print 'Successful get from', source
  19. else:
  20.     print 'FAILED'
Add Comment
Please, Sign In to add comment