Guest User

Untitled

a guest
Jan 12th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import sys, time, os
  2.  
  3. _File = 'TemperatureData1.csv'
  4. _newDir = '/home/pi/Documents/Temperature Data Logs'
  5. _directoryList = os.listdir(_newDir)
  6.  
  7. os.chdir(_newDir)
  8.  
  9. # Here I am specifying the file, that I want to write to it, and that
  10. # I want to use a buffer of 5kb
  11. output = open(_File, 'w', 5000)
  12.  
  13. try:
  14. while (1):
  15. output.write('hin')
  16. time.sleep(0.01)
  17.  
  18. except KeyboardInterrupt:
  19. print('Keyboard has been pressed')
  20. output.close()
  21. sys.exit(1)
Add Comment
Please, Sign In to add comment