interface.py 文件源码

python
阅读 38 收藏 0 点赞 0 评论 0

项目:iFruitFly 作者: AdnanMuhib 项目源码 文件源码
def browse_picture(self):
        self.image = QtGui.QFileDialog.getOpenFileName(None,'OpenFile','c:\\',"Image file(*.png *.jpg)")
        #self.progressBar.setValue(0)
        self.image = str(self.image)
        self.labeLAnomaly.setStyleSheet("QLabel {background-color:red;color:white;}")
        self.file_name = ntpath.basename(self.image)
        self.file_name, ext=os.path.splitext(self.file_name)
        self.file_path = ntpath.dirname(self.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 self.image:
            self.imgPreview.setPixmap(QtGui.QPixmap(self.image).
                                           scaled(self.imgPreview.width(),
                                                  self.imgPreview.height()))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号