summaryrefslogtreecommitdiffstats
path: root/For Weekly Test/30-07-2011/DeviceAddress.py
diff options
context:
space:
mode:
Diffstat (limited to 'For Weekly Test/30-07-2011/DeviceAddress.py')
-rw-r--r--For Weekly Test/30-07-2011/DeviceAddress.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/For Weekly Test/30-07-2011/DeviceAddress.py b/For Weekly Test/30-07-2011/DeviceAddress.py
new file mode 100644
index 0000000..1211b43
--- /dev/null
+++ b/For Weekly Test/30-07-2011/DeviceAddress.py
@@ -0,0 +1,23 @@
+class DeviceAddress:
+
+ def __init__(self):
+ self.add = None
+ self.num = None
+
+ def findDevice(self, device):
+ file = open('DeviceAddress.txt', 'r')
+
+ for line in file:
+
+ first = line.find('[')
+ second= line.find(']') # search for position
+ find = line[first+1:second]
+
+ space = line.find(' ')
+ newLine =line[space+1:]
+ space2 = newLine.find(' ')
+
+ if find == device:
+ self.add = newLine[0:space2]
+ self.num = newLine[space2+1:]
+ file.close()