aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2021-04-02 11:09:46 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2021-04-02 11:09:46 -0400
commitfa51cdb682d792d39921128481fcd097726ccfca (patch)
treee5541a6e6f616896744e2ef1d89457672a1e2081
parent3050bceb81a51b9f6cb0933938780de79179044b (diff)
downloadqolab-fa51cdb682d792d39921128481fcd097726ccfca.tar.gz
qolab-fa51cdb682d792d39921128481fcd097726ccfca.zip
clean up
-rw-r--r--panel.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/panel.py b/panel.py
index a9fab18..a5003fa 100644
--- a/panel.py
+++ b/panel.py
@@ -6,14 +6,14 @@ import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg, NavigationToolbar2Tk)
-cnt=1
class Experiment:
def __init__(self, root):
- self.gui(root)
+ self.cnt = 1
+ self.guiSetup(root)
- def gui(self, root):
+ def guiSetup(self, root):
self.bStart=Button(root,text="START",command=self.hello,font=('Arial','24'))
self.bStart.pack()
@@ -42,17 +42,12 @@ class Experiment:
self.canvas.get_tk_widget().pack()
def hello(self):
- global cnt
- cnt = cnt + 1
- self.ax.plot([i for i in range(20)],[i/cnt for i in range(20)])
+ self.cnt = self.cnt + 1
+ self.ax.plot([i for i in range(20)],[i/self.cnt for i in range(20)])
self.canvas.draw()
- print("Hello ")
- print(cnt)
if __name__ == '__main__':
- cnt=1
-
root=Tk()
Experiment(root)