Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import time
- from sys import argv
- t1input = 0
- t1output = 0
- t2input = '0'
- argv1 = "ex.csv"
- script, filename = argv, argv1
- f = open(filename, 'r')
- setstate = 'green'
- while True:
- for i, line in enumerate(f):
- #print (line)[36:-4:]
- abc1 = (line)[36:-11:]
- abc2 = float(abc1)
- abc3 = int(abc2)
- t1input = abc2
- t2input = t1input/1
- print "t1input = %s" % t1input
- print "tank2 = %s" % t2input
- if t2input != t1output:
- if t2input <= (t1input/100)*25:
- setstate = 'red'
- elif t2input <= (t1input/100)*50:
- setstate = 'amber'
- else:
- setstate = 'green'
- print "state is %s" % setstate
- time.sleep(5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement