Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. from Tkinter import *
  2.  
  3. import tkFileDialog
  4.  
  5. import sys
  6. if sys.version_info[0] < 3:
  7. import Tkinter as Tk
  8. else:
  9. import tkinter as Tk
  10.  
  11. import os
  12. import tkMessageBox
  13. root = Tk.Tk()
  14. root.title("Excel Map Conversion")
  15. root.geometry("450x400")# width x height
  16.  
  17. def browse_gainInfo():
  18. currentDir = os.getcwd()
  19. fname = tkFileDialog.askdirectory(parent=root, initialdir=currentDir, title="Please Select the Folder for Map Data Input")
  20. pathlabel.config(text=fname)
  21.  
  22. filepath = StringVar()
  23.  
  24. def texas():
  25. os.startfile(browseLink + '/Texas/Texas_conversion.py')
  26.  
  27. def state():
  28. os.startfile(filepath.get() + 'StateStateConv.py')
  29.  
  30. def college():
  31.  
  32. os.startfile(filepath.get() + 'CollegeCollegeConv.py')
  33.  
  34. def underGrad():
  35. os.startfile(filepath.get() + 'Undergraduateundergrad_conversion.py')
  36.  
  37. def grad():
  38. os.startfile(filepath.get()+ 'Graduategraduate_conversion.py')
  39.  
  40. browseLabel = Label(root, text="Browse for source of Map Data").pack()
  41. browse1 = Tk.Button(root, text='Browse', width =6, command = browse_gainInfo)
  42. browse1.pack()
  43. pathlabel= Label(root)
  44. pathlabel.pack()
  45.  
  46. browseLink = StringVar(pathlabel)
  47.  
  48. label = Label(root, text="nEnter in the filepath for the map files: n").pack()
  49. link = Entry(root, textvariable = filepath).pack()
  50.  
  51.  
  52. label2 = Label(root, text ="ntPlease select from the following options:n").pack()
  53.  
  54. button1 = Button(root, text = "College", command = college).pack()
  55.  
  56. button2 = Button(root, text= "State", command = state).pack()
  57.  
  58. button3 = Button(root, text="Texas", command = texas).pack()
  59.  
  60. button4 = Button(root, text ="Undergraduate", command = underGrad).pack()
  61.  
  62. button5 = Button(root, text ="Graduate", command = grad).pack()
  63.  
  64.  
  65.  
  66. #kick off the event loop
  67. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement