-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
77 lines (62 loc) · 2.01 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
from tkinter import *
from tkinter import ttk, filedialog
from tkinter.ttk import *
from tkinter.filedialog import askopenfile
import os
from experiments.exp1 import main as main1
from experiments.exp2 import main as main2
from experiments.exp3 import main as main3
from experiments.exp4 import main as main4
def solve():
index = choice.current()
path = nav_display.get("1.0", "end-1c")
if index==0:
main1(path, content, graphics, g_nav)
elif index==1:
main2(path, content, graphics, g_nav)
elif index==2:
main3(path, content, graphics, g_nav)
elif index==3:
main4(path, content, graphics, g_nav)
def open_file():
file=filedialog.askopenfile()
if file:
filepath = os.path.abspath(file.name)
nav_display.delete("1.0", "end")
nav_display.insert(END, filepath)
root = Tk()
root.title("Graphicit")
root.geometry("1000x600")
icon = PhotoImage(file="/Users/varnan/Desktop/Project - PHYLAB/pythonProject/icon.png")
root.iconphoto(False, icon)
left = Frame(root)
right = Frame(root)
left.pack(side=LEFT)
right.pack(side=RIGHT)
nav = Frame(left, height=70, width=500)
content = LabelFrame(left, text="Content", height=500, width=480)
nav.grid(row=0, padx=5, pady=5)
content.grid(row=1, padx=5, pady=5)
graphics = LabelFrame(right, text="Graphs & Tables", height=510, width=480)
g_nav = LabelFrame(right, text="Navigation Pane", height=50, width=480)
graphics.grid(row=0, padx=5, pady=5)
g_nav.grid(row=1, padx=5, pady=5)
choice = ttk.Combobox(
nav,
state="readonly",
values=[
"1. Ohm's Law",
"2. Numeric Aperture",
"3. Bending Loss",
"4. Hall Effect"
],
width=15
)
choice.grid(row=0, column=0, pady=6, padx=6)
nav_display = Text(nav, height=3, width=30)
nav_display.grid(row=0, column=2, padx=10, rowspan=2)
browse = Button(nav, text="BROWSE", command=open_file)
browse.grid(row=0, column=1)
submit = Button(nav, text="SUBMIT", command=solve, width=20)
submit.grid(row=1, column=0, columnspan=2, pady=3)
root.mainloop()