Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. from Tkinter import *
  2. import tkFileDialog
  3. import tkMessageBox
  4. import routine1
  5. import routine2
  6. import sys
  7.  
  8. class Analysis(Frame):
  9. def __init__(self):
  10. Frame.__init__(self)
  11. self.text = Text(self, height=20, width=60) # 20 characters
  12. self.pack()
  13.  
  14. scroll=Scrollbar(self)
  15. scroll.pack(side=RIGHT, fill=Y)
  16. scroll.config(command=self.text.yview)
  17. self.text.config(background='white')
  18. self.text.pack(expand=YES, fill=BOTH)
  19.  
  20.  
  21. def selectfile(self):
  22. fname = tkFileDialog.askopenfilename()
  23. self.text.delete(1.0, END)
  24. self.text.insert(INSERT, ' working on routine 1: n')
  25. routine1.main(fname)
  26. self.text.insert(INSERT, ' routine 1 done: n')
  27. self.text.insert(INSERT, ' working on routine 2: n')
  28. routine2.main(fname)
  29. self.text.insert(INSERT, ' routine 2 done: ')
  30. sys.exit()
  31.  
  32. def main():
  33. tk = Tk()
  34. tk.title('Data Analysis')
  35.  
  36. atext = Analysis()
  37. atext.pack()
  38. open_button = Button(tk, text="Select Data",
  39. activeforeground='blue', command=atext.selectfile)
  40. open_button.pack()
  41.  
  42. message='''
  43. Select file to be analysized
  44. '''
  45. atext.text.insert(END,message)
  46. tk.mainloop()
  47.  
  48. if __name__ == "__main__":
  49. main()
  50.  
  51. #routine1.py=
  52.  
  53. import time
  54. def main(Filename):
  55. print Filename
  56. time.sleep(1) # to simulate process time
  57. return
  58.  
  59. #routine2.py=
  60.  
  61. import time
  62. def main(Filename):
  63. print Filename
  64. time.sleep(1) # to simulate process time
  65. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement