-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGUI.py
More file actions
29 lines (22 loc) · 960 Bytes
/
GUI.py
File metadata and controls
29 lines (22 loc) · 960 Bytes
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
### an interface to plot car data ###
from tkinter import *
from tkinter import ttk
import plot_price_vs_power
import os
class app():
def __init__(self):
self.root = Tk()
self.root.title('Plot Edmunds.com Data')
self.mainframe = Frame(self.root, height = 800, width = 1200)
self.mainframe.pack_propagate(0)
self.mainframe.pack(padx = 10, pady = 10)
intro = Label(self.mainframe, text= 'Welcome to the Edmunds.com Data Plotter.\nPlease select an automaker to explore:')
intro.pack(side=TOP)
names = os.listdir('CarData')
names = [(filename[:-5]).title() for filename in names]
self.makevar = StringVar()
self.make = ttk.Combobox(self.mainframe, textvariable = self.makevar, values=names)
self.make.current()
self.make.bind('<<ComboboxSelected>>', plot_price_vs_power.plotdata)
self.make.pack()
app()