-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.py
35 lines (32 loc) · 1.19 KB
/
gui.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
import Tkinter as tk
import os
from tkFileDialog import askopenfilename
#from tkMessageBox import showerror
class Application(tk.Frame):
def __init__(self, master=None):
tk.Frame.__init__(self, master)
self.grid()
self.createWidgets()
def createWidgets(self):
self.pattern = tk.Entry(self, text = '').pack()
self.database_path = tk.Button(self, text = 'Select your database',
command = self.getfilepath).pack()
self.searchButton = tk.Button(self, text = 'search',
command = self.parseSeq).pack()
def getfilepath(self):
# define options for opening or saving a file
self.file_opt = options = {}
options['defaultextension'] = '.fasta'
options['filetypes'] = [('all files', '.*'), ('database files', '.fasta')]
options['initialdir'] = os.getcwd()
options['initialfile'] = 'myfile.txt'
options['parent'] = root
options['title'] = 'This is a title'
fname = askopenfilename(**self.file_opt)
print fname
def parseSeq(self):
return;
if __name__ == "__main__":
root = tk.Tk()
app = Application(master = root)
app.mainloop()