Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- import csv
- from string import split
- import getpass
- import sys
- import telnetlib
- import subprocess
- Host = "192.168.1.10"
- PORT = 5024
- TIMEOUT =10
- i = open('practice1.csv', 'wb')
- tn = telnetlib.Telnet(Host,PORT)
- print "You log in"
- time.sleep(5)
- while True:
- #Powertemp1 = subprocess.check_output(["Measure:Power?"])
- #tn.write("Measure:Power?")
- tn.write("*IDN?")
- Powertemp1 = tn.read_all()
- print type(Powertemp1)
- print Powertemp1
- #Powertemp = float(Powertemp1)
- #print '&s' % Powertemp
- #wr = csv.writer(i, dialet = 'excel')
- #wr.writerow([Powertemp])
- time.sleep(5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement