mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 18:25:57 +01:00
41 lines
841 B
Python
Executable File
41 lines
841 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import argparse
|
|
import collections
|
|
import sys
|
|
import os
|
|
|
|
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))))
|
|
import common
|
|
|
|
data = common.LkmcOrderedDict()
|
|
|
|
# Parse
|
|
|
|
output = common.LkmcList()
|
|
next(sys.stdin)
|
|
for line in sys.stdin:
|
|
line = line.rstrip()
|
|
if line == '':
|
|
break
|
|
output.append(int(line))
|
|
data['output'] = output
|
|
|
|
times = common.LkmcList()
|
|
next(sys.stdin)
|
|
for line in sys.stdin:
|
|
line = line.rstrip()
|
|
if line == '':
|
|
break
|
|
times.append(common.LkmcList([int(i) for i in line.split(' ')], oneline=True))
|
|
data['times'] = times
|
|
|
|
# Handle CLI arguments.
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument('key', nargs='?')
|
|
args = parser.parse_args()
|
|
if args.key:
|
|
print(data[args.key])
|
|
else:
|
|
print(data)
|