-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfinal.py
More file actions
36 lines (31 loc) · 940 Bytes
/
Copy pathfinal.py
File metadata and controls
36 lines (31 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import time, sys, signal, atexit
import pyupm_i2clcd as sainsmartObj
## Exit handlers ##
# This stops python from printing a stacktrace when you hit control-C
def SIGINTHandler(signum, frame):
raise SystemExit
# This function lets you run code on exit,
# including functions from ringCoder
#def exitHandler():
# print "Exiting"
# sys.exit(0)
# Register exit handlers
#atexit.register(exitHandler)
signal.signal(signal.SIGINT, SIGINTHandler)
# Instantiate a Sainsmart LCD Keypad Shield using default pins
lcd = sainsmartObj.SAINSMARTKS()
lcd.clear()
lcd.setCursor(0,0)
lcd.write("Interecepted Jet")
f = file('log.txt')
try:
lcd.setCursor(1,0)
for line in f:
if "Aircraft Identification : " in line:
print line[38:]
lcd.write(line[38:45])
break
else:
lcd.write("Still Searching..")
except:
print "End"