ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/RandomCodeRequests/dave_code.txt
Revision: 8
Committed: Sat May 5 04:21:19 2012 UTC (13 years, 10 months ago) by ninoborges
Content type: text/plain
File size: 863 byte(s)
Log Message:
Initial Import

File Contents

# Content
1 >>> outputFile = open(r"C:\Test_dir\Dave.txt",'w')
2 >>> matrix = {}
3 >>> for line in contents:
4 ... line = line.replace("\n","")
5 ... BegNo, EndNo, BegAtt, EndAtt = line.split(',')
6 ... matrix[BegNo] = EndNo
7 ... if BegNo == BegAtt:
8 ... pass
9 ... else:
10 ... if BegAtt:
11 ... outputFile.write(BegNo + "," + BegAtt + " - "+ matrix[BegAtt] + "\n")
12 ... else:
13 ... print "err! %s has no begAtt value!"% BegNo
14 ...
15 err! BHS 00038086 has no begAtt value!
16 err! BHS 00038127 has no begAtt value!
17 err! BHS 00038161 has no begAtt value!
18 err! BHS 00038213 has no begAtt value!
19 err! BHS 00038267 has no begAtt value!
20 err! BHS 00095748 has no begAtt value!
21 err! BHS 00095749 has no begAtt value!
22 err! BHS 00095750 has no begAtt value!
23 Traceback (most recent call last):
24 File "<interactive input>", line 9, in <module>
25 KeyError: 'BHS 00095752'