30 lines
766 B
Python
Executable File
30 lines
766 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import argparse
|
|
import csv
|
|
import datetime
|
|
import pathlib
|
|
|
|
import matplotlib.pyplot as plt
|
|
|
|
def plot(paths):
|
|
for path in paths:
|
|
timestamps = [datetime.datetime.now()]
|
|
with open(path) as f:
|
|
reader = csv.reader(f)
|
|
for (_, _, tstr) in reader:
|
|
timestamp = datetime.datetime.strptime(tstr, "%d %b %y (%H:%M)")
|
|
timestamps.append(timestamp)
|
|
|
|
plt.stairs(range(1, len(timestamps)), edges=timestamps[::-1], baseline=None)
|
|
|
|
plt.show()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("-f", "--file", nargs='+', type=pathlib.Path, required=True, help="solve history CSV")
|
|
|
|
args = parser.parse_args()
|
|
plot(args.file)
|