Advertisement
Guest User

Untitled

a guest
May 6th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. import time
  2. import csv
  3. from string import split
  4. import getpass
  5. import sys
  6. import telnetlib
  7. import subprocess
  8.  
  9. Host = "192.168.1.10"
  10. PORT = 5024
  11. TIMEOUT =10
  12. i = open('practice1.csv', 'wb')
  13.  
  14. tn = telnetlib.Telnet(Host,PORT)
  15.  
  16. print "You log in"
  17.  
  18. time.sleep(5)
  19.  
  20. while True:
  21. #Powertemp1 = subprocess.check_output(["Measure:Power?"])
  22. #tn.write("Measure:Power?")
  23. tn.write("*IDN?")
  24. Powertemp1 = tn.read_all()
  25. print type(Powertemp1)
  26. print Powertemp1
  27. #Powertemp = float(Powertemp1)
  28. #print '&s' % Powertemp
  29. #wr = csv.writer(i, dialet = 'excel')
  30. #wr.writerow([Powertemp])
  31. time.sleep(5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement