def browse_picture(self):
image = QtGui.QFileDialog.getOpenFileName(None,'OpenFile','c:\\',"Image file(*.png *.jpg)")
self.progressBar.setValue(0)
image = str(image)
print(image)
self.file_name = ntpath.basename(image)
self.file_name, ext=os.path.splitext(self.file_name)
self.file_path = ntpath.dirname(image)
self.write_path = ntpath.expanduser('~\\Documents\\Document Analysis')
# creating write path if not exists
if not os.path.exists(self.write_path):
os.makedirs(self.write_path)
if image:
self.labelInputImage.setPixmap(QtGui.QPixmap(image).
scaled(self.labelInputImage.width(),
self.labelInputImage.height()))
评论列表
文章目录