Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from Tkinter import *
- import tkFileDialog
- import sys
- if sys.version_info[0] < 3:
- import Tkinter as Tk
- else:
- import tkinter as Tk
- import os
- import tkMessageBox
- root = Tk.Tk()
- root.title("Excel Map Conversion")
- root.geometry("450x400")# width x height
- def browse_gainInfo():
- currentDir = os.getcwd()
- fname = tkFileDialog.askdirectory(parent=root, initialdir=currentDir, title="Please Select the Folder for Map Data Input")
- pathlabel.config(text=fname)
- filepath = StringVar()
- def texas():
- os.startfile(browseLink + '/Texas/Texas_conversion.py')
- def state():
- os.startfile(filepath.get() + 'StateStateConv.py')
- def college():
- os.startfile(filepath.get() + 'CollegeCollegeConv.py')
- def underGrad():
- os.startfile(filepath.get() + 'Undergraduateundergrad_conversion.py')
- def grad():
- os.startfile(filepath.get()+ 'Graduategraduate_conversion.py')
- browseLabel = Label(root, text="Browse for source of Map Data").pack()
- browse1 = Tk.Button(root, text='Browse', width =6, command = browse_gainInfo)
- browse1.pack()
- pathlabel= Label(root)
- pathlabel.pack()
- browseLink = StringVar(pathlabel)
- label = Label(root, text="nEnter in the filepath for the map files: n").pack()
- link = Entry(root, textvariable = filepath).pack()
- label2 = Label(root, text ="ntPlease select from the following options:n").pack()
- button1 = Button(root, text = "College", command = college).pack()
- button2 = Button(root, text= "State", command = state).pack()
- button3 = Button(root, text="Texas", command = texas).pack()
- button4 = Button(root, text ="Undergraduate", command = underGrad).pack()
- button5 = Button(root, text ="Graduate", command = grad).pack()
- #kick off the event loop
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement