猫史档案馆


【Python作品分享】滑稽內存清理【作品秀】

用户:把ROG全家桶抱回家把ROG全家桶抱回家查看:0 回复:0 评论:0 创建时间:2021-01-28T23:41:06


【作品展示】

center_image

 

【作品介绍】

請搭配上面滑稽圖片(請更改文件名為hj.jpg)和 https://shequ.codemao.cn/community/360249 使用

——————分隔線——————

*本為作者原創玩法,請大神自由更改代碼,以發揮其最大價值*

 

【作品源代码】

import sys
from PySide2.QtWidgets import *
from PySide2.QtGui import *
from PySide2.QtCore import *
from ui_ram import Ui_neicun


class Ui_neicun(QMainWindow, Ui_neicun):
    def __init__(self):
        super().__init__()
        self.setupUi(self)
        self.show()
        self.init_button()
        self.pbtn_h1.clicked.connect(self.huaji)
        self.pbtn_h2.clicked.connect(self.huaji)
        self.pbtn.clicked.connect(self.clear)

    def init_button(self):
        pbtn_list = [self.pbtn_h1 ,self.pbtn_h2]
        for btn in pbtn_list:
            btn.setText('')
            btn.setIcon(QIcon('hj.jpg'))
            btn.setIconSize(QSize(140, 140))
            btn.setCheckable(True)

    def huaji(self):
        QMessageBox.information(self,'滑稽','[滑稽]')

    def clear(self):
        QMessageBox.information(self, '滑稽', '已清理內存')

if __name__ == '__main__':
    app = QApplication(sys.argv)
    window = Ui_neicun()
    sys.exit(app.exec_())

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页