-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirst_pr.py
More file actions
37 lines (29 loc) · 870 Bytes
/
first_pr.py
File metadata and controls
37 lines (29 loc) · 870 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
#!/usr/bin/python
#Script test for a vlookup in python
#
import sys, getopt
#Elements to find
def main(argv):
listtofind = ''
filetolook = ''
outputfile = ''
try:
opts, args = getopt.getopt(argv,"hl:i:o:",["lfile=","ifile=","ofile="])
except getopt.GetoptError:
print 'first_pr.py -l <listtofind> -i <filetolook> -o <outputfile>'
sys.exit(2)
for opt, arg in opts:
if opt == '-h':
print 'first_pr.py -l <listtofind> -i <filetolook> -o <outputfile>'
sys.exit()
elif opt in ("-l","--lfile"):
listtofind=arg
elif opt in ("-i","--filetolook"):
filetolook= arg
elif opt in ("-o","--outputfile"):
outputfile=arg
print listtofind
print filetolook
print outputfile
if __name__ == "__main__":
main(sys.argv[1:])