-
Notifications
You must be signed in to change notification settings - Fork 0
/
hamming_dist.py
50 lines (31 loc) · 1.06 KB
/
hamming_dist.py
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env python3
"""
Author : loicborcard <loicborcard@localhost>
Date : 2022-11-05
Purpose: Rock the Casbah
"""
import argparse
# --------------------------------------------------
def get_args():
parser = argparse.ArgumentParser(
description='Rock the Casbah',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('positional',
metavar='str',
help='A positional argument')
parser.add_argument('-f',
'--file',
help='A readable file',
metavar='FILE',
type=argparse.FileType('rt'),
default=sys.stdin)
return parser.parse_args()
# --------------------------------------------------
def main():
"""Make a jazz noise here"""
args = get_args()
file_arg = args.file
print('file_arg = "{}"'.format(file_arg.name if file_arg else ''))
# --------------------------------------------------
if __name__ == '__main__':
main()