Advertisement

PyQt5: QFileDialog(22)

阅读量:

研读《PyQt4入门指南 PDF中文版.pdf》过程中整理的学习记录

文件对话框为用户提供了一个选择文件或文件夹的界面,所选文件可执行读取或写入操作。

复制代码
 <span style="font-size:12px;">#!/usr/bin/python

    
 # openfiledialog.py
    
  
    
 from PyQt5.QtWidgets import QApplication, QAction, QFileDialog,  QTextEdit
    
 from PyQt5 import QtWidgets
    
 from PyQt5.QtCore import Qt
    
 from PyQt5.QtGui import QIcon
    
  
    
 class OpenFile(QtWidgets.QMainWindow):
    
     def __init__(self, parent= None):
    
     QtWidgets.QWidget.__init__(self)
    
     

全部评论 (0)

还没有任何评论哟~