From d4b3304105020515d752f1143692852dc9204973 Mon Sep 17 00:00:00 2001 From: DawidSchneider Date: Sat, 26 Oct 2024 23:41:41 +0200 Subject: [PATCH] n jako parametr --- main.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 42ae358..896e67e 100644 --- a/main.py +++ b/main.py @@ -1,8 +1,9 @@ import matplotlib.pyplot as plt import numpy as np +import sys class Plot: - def __init__(self): + def __init__(self, n): self.fig, self.ax = plt.subplots() self.cid_click = self.fig.canvas.mpl_connect('button_press_event', self.onclick) @@ -17,7 +18,7 @@ class Plot: self.curvePoints = [] self.isDrawing = False self.inputMode = 0 - self.n = 15 + self.n = n def onclick(self, event): if self.inputMode == 0: @@ -63,7 +64,10 @@ class Plot: def run(self): plt.show() +n = 10 +if len(sys.argv) > 1: + n = int(sys.argv[1]) if __name__ == "__main__": - plot = Plot() + plot = Plot(n) plot.run()