-1
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 "****"
此代碼片段不會在控制檯上打印任何內容。打印「****」不起作用。而且,如果發射top.mainloop(),則不會顯示tk窗口。如何解決這個問題?在fsr
這樣不在控制檯上打印任何東西
解決您的壓痕。您的代碼無法運行。 – khelwood
實際代碼中的縮進是正確的。在這裏複製時可能會搞砸了。請告訴代碼有什麼問題。 – user3848981
根據您的建議更正了縮進。請現在檢查.. – user3848981