Tkinter GUI

Great source: https://www.youtube.com/watch?v=D8-snVfekto

import tkinter as tk from tkinter import filedialog, Text from tkinter import ttk HEIGHT = 300 WIDTH = 400 #are these all that's needed for TKinter for mac? yes #how to check if homebrew works? use brewdoctor root = tk.Tk() #intiating application root.title('Battery GUI') #Single cell data tab --------------------------- my_notebook = ttk.Notebook(root) my_notebook.pack(pady=15) canvas1 = tk.Canvas(my_notebook, height = HEIGHT, width = WIDTH, bg = 'black') canvas1.pack() frame1 = tk.Frame(canvas1, bg = 'black') frame1.place(relx=0.1, rely=0.1, relwidth=0.8, relheight=0.8) my_notebook.add(canvas1, text = "Single-Cell Data") button = tk.Button(frame1, text = "Let's go", highlightbackground = 'black') button.pack(side = 'bottom') #puts button on the screen label = tk.Label(frame1, text = "Battery cell testing results!", bg= 'black',fg = 'white') label.pack() label2 = tk.Label(frame1, text = "Enter the cell number", bg= 'black',fg = 'white') label2.pack() entry = tk.Entry(frame1) entry.pack() #Multi cell data tab --------------------------- canvas2 = tk.Canvas(my_notebook, height = HEIGHT, width = WIDTH, bg = 'black') canvas2.pack() frame2 = tk.Frame(canvas2, bg = 'black') frame2.place(relx=0.1, rely=0.1, relwidth=0.8, relheight=0.8) my_notebook.add(canvas2, text = "Multi-Cell Data") button2 = tk.Button(frame2, text = "Let's go", highlightbackground = 'black') button2.pack(side = 'bottom') #puts button on the screen label = tk.Label(frame2, text = "Battery cell testing results!", bg= 'black',fg = 'white') label.pack() label2 = tk.Label(frame2, text = "Enter a cell range", bg= 'black',fg = 'white') label2.pack() label_black = tk.Label(frame2, text = " ", bg= 'black',fg = 'white') label_black.pack() label3 = tk.Label(frame2, text = "From cell number", bg = 'black',fg = 'white') label3.pack() entry = tk.Entry(frame2) entry.pack() label4 = tk.Label(frame2, text = "To cell number", bg = 'black',fg = 'white') label4.pack() entry2 = tk.Entry(frame2) entry2.pack() #Glossary tab --------------------------- canvas2 = tk.Canvas(my_notebook, height = HEIGHT, width = WIDTH, bg = 'black') canvas2.pack() frame2 = tk.Frame(canvas2, bg = 'black') frame2.place(relx=0.1, rely=0.1, relwidth=0.8, relheight=0.8) my_notebook.add(canvas2, text = "Glossary") def_ACV = tk.Label(frame2, text = "Alternating Current Voltage (ACV): ", bg= 'black',fg = 'white') def_ACV.pack() def_CCV = tk.Label(frame2, text = "Closed Circuit Voltage (CCV): ", bg= 'black',fg = 'white') def_CCV.pack() def_DC = tk.Label(frame2, text = "Direct Current (DC): ", bg= 'black',fg = 'white') def_DC.pack() def_IR = tk.Label(frame2, text = "Internal Resistance (IR)): ", bg= 'black',fg = 'white') def_IR.pack() def_OCV = tk.Label(frame2, text = "Open-Circuit Voltage (OCV): ", bg= 'black',fg = 'white') def_OCV.pack() def_Pulse = tk.Label(frame2, text = "Pulse Tests: ", bg= 'black',fg = 'white') def_Pulse.pack() root.mainloop() #runs the GUI