mirror of
https://github.com/janishutz/BiogasControllerApp.git
synced 2025-11-25 05:44:23 +00:00
added plot generator to project
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
"""This Program is CLI only!"""
|
"""This Program is CLI only!"""
|
||||||
|
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import numpy as np
|
|
||||||
import csv
|
import csv
|
||||||
import os
|
import os
|
||||||
|
|
||||||
path = input("Path to csv-file to be plotted: ")
|
path = input("Path to csv-file to be plotted: ")
|
||||||
date = input("Date & time at which the measurement was taken (approx.): ")
|
date = input("Date & time at which the measurement was taken (approx.): ")
|
||||||
|
group = input("Group-name: ")
|
||||||
saveit = input("Should the graph be saved? (y/n) ").lower()
|
saveit = input("Should the graph be saved? (y/n) ").lower()
|
||||||
|
|
||||||
imp = open(path, "r")
|
imp = open(path, "r")
|
||||||
@@ -41,7 +41,7 @@ if saveit == "y":
|
|||||||
except FileExistsError:
|
except FileExistsError:
|
||||||
pass
|
pass
|
||||||
plt.savefig(save_path)
|
plt.savefig(save_path)
|
||||||
os.rename(f"{save_path}/.png", f"{save_path}/GC-{date}.png")
|
os.rename(f"{save_path}/.png", f"{save_path}/GC-{date}-{group}.png")
|
||||||
print(f"saved images to {save_path}")
|
print(f"saved images to {save_path}")
|
||||||
else:
|
else:
|
||||||
print("didn't save images")
|
print("didn't save images")
|
||||||
|
|||||||
Reference in New Issue
Block a user