import Tkinter
import tkMessageBox
import xlwt
from xlrd import open_workbook
from tempfile import TemporaryFile
from xlwt import Workbook
import tkSimpleDialog
import tkMessageBox
from tkFileDialog import *
top = Tkinter.Tk()
#FSR
def fsr():
tkMessageBox.showinfo("Open", "Select Feedback file")
filename1 = askopenfilename(filetypes=[("Excel worksheets","*.xls")])
if filename1=='':
tkMessageBox.showerror('Error', 'All files must be uploaded')
fsr()
B1 = Tkinter.Button(top, text = "Details upload", command = fsr)
B1.pack()
top.mainloop()
wb1 = open_workbook(filename1)
sheet1 = wb1.sheet_by_index(0)
batch = []
print "****"
for row in range(sheet1.nrows):
if(row!=0):
batch.append(sheet1.cell(row,16).value)
print "****"
This code snippet does not print anything on console. The print "****" is not working. And also, if top.mainloop() is emitted, the tk window is not showing. How to solve this?