PyQt5 PyQt5是一个基于强大的图形程式框架Qt5的python接口, 主要包含以下几个大类: ● QtCore ● QtGui ● QtWidgets ● QtMultimedia ● QtBluetooth ● QtNetwork ● QtPositioning ● Enginio ● QtWebSockets ● QtWebKit ● QtWebKitWidgets ● QtXml ● QtSvg ● QtSql ● QtTest QtCore模块涵盖了包的核心的非GUI功能,此模块…
import sys from math import * from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * class Form(QDialog): def __init__(self,parent=None): super().__init__(parent) layout = QVBoxLayout() self.setLayout(layout) def updateUi(…
import sys from math import * from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * class Form(QDialog): def __init__(self, parent=None): super().__init__(parent) self.browser = QTextBrowser() self.lineedit = QLineEdit("T…
之前只是放到github上了,现在一想应该开源,大家想继续做好这个ide的都能从这里起步. #注意在.py文件相同目录下放一个1.png做测试图片 #本质就是用html来实现图片 #写在前面的话:这个程序在python自带ide里面遇到bug就秒退,看不了提示信息 #解决方法如下: #用cmd 在文件目录里面执行python lastversion.py即可运行 #并且可以进行调试,会返回出错信息,比自带ide好多了. #总之:别用ide来调试. #English for upper Chine…
python太博大精深了,使用场景非常多.最近笔者一直使用PyQt5编一些小程序,顺便就把一些常用的东西列出来,做个记录和积累吧.进度条是非常常用的东西,今天用的时候,顺便温习了一下,这个东西自己感觉没啥可讲的,最好的办法就是例子来说明:下面给一个简单的例子. 基本进度条使用: 进度条的函数如下: self.pbar = QProgressBar(self) //进度条的定义 self.pbar.setGeometry(30, 60, 100, 30) //进度条的大小和位置,前两个是位置,后两…
from PyQt5 import QtCore, QtGui, QtWidgets import sys import qtawesome class MainUi(QtWidgets.QMainWindow): def __init__(self): super().__init__() self.init_ui() def init_ui(self): self.setFixedSize(960, 700) self.main_widget = QtWidgets.QWidget() #…
This is a note for https://class.coursera.org/interactivepython-005 In week two, I have learned: 1.event-drvien programing 4 event types: Input: button, textbox Keyborad: key up, key down Mouse: click, drag Timer example: # Example of a simple event-…
Mini-project description - Rock-paper-scissors-lizard-Spock Rock-paper-scissors is a hand game that is played by two people. The players count to three in unison and simultaneously "throw" one of three hand signals that correspond to rock, paper…
#Practice Exercises for Logic and Conditionals # Solve each of the practice exercises below. # 1.Write a Python function is_even that takes as input the parameter number (an integer) and # returns True if number is even and False if number is odd. #…
# Practice Exercises for Functions # Solve each of the practice exercises below. # 1.Write a Python function miles_to_feet that takes a parameter miles and # returns the number of feet in miles miles. def miles_to_feet(miles): feet = miles * 5280 ret…