def onFilePicker(self):
ftypes = [('PNG Files', '*.png'), ('All files', '*')]
dlg = tkFileDialog.Open(self, initialdir='../testcase_image/', filetypes = ftypes)
choosedFile = dlg.show()
if choosedFile != '':
print choosedFile
self.imageName = str(choosedFile).split("/")[-1]
self.imagePath = str(choosedFile).replace(self.imageName, '')
self.textBoxFile.config(state='normal')
self.textBoxFile.delete('1.0', END)
self.textBoxFile.insert(END, choosedFile)
self.textBoxFile.config(state='disabled')
newImageLeft = Image.open(choosedFile)
imageLeftLabel = ImageTk.PhotoImage(newImageLeft)
self.labelLeft = Label(self, image=imageLeftLabel)
self.labelLeft.image = imageLeftLabel
self.labelLeft.place(x=5, y=100)
imageRight = Image.open("resource/empty.png")
imageRightLabel = ImageTk.PhotoImage(imageRight)
self.labelRight = Label(self, image=imageRightLabel)
self.labelRight.image = imageRightLabel
self.labelRight.place(x=525, y=100)
pass
main_GUI.py 文件源码
python
阅读 16
收藏 0
点赞 0
评论 0
评论列表
文章目录