Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from Tkinter import *
- from xlrd import open_workbook,cellname,empty_cell,XL_CELL_TEXT,error_text_from_code, cellnameabs, colname
- book= open_workbook('Grades.xls')
- sheet=book.sheet_by_index(0)
- def search():
- s = []
- a = str(name.get())
- x = [a]
- for row in range(sheet.nrows):
- for col in range(sheet.ncols):
- s.append(str(sheet.cell(row,col).value))
- if x == s:
- for col in range(sheet.ncols):
- s=[]
- s.append(str((sheet.cell(row,col).value)))
- result.config(text=str(s))
- # print (s)
- # s=[]
- # elif x != s:
- # s=[]
- # search()
- win = Tk()
- instruct = Label(win, text="Type in a name")
- instruct.pack()
- student = str()
- name = Entry(win, textvariable=student)
- name.pack()
- result = Label(win, textvariable=s.append(str((sheet.cell(row,col).value))))
- result.pack()
- choosecvt = Button(win, text='student data',command=search, bg='red')
- choosecvt.pack()
- win.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement