美文网首页
树梅派中的GUI编程

树梅派中的GUI编程

作者: 古三井 | 来源:发表于2017-11-12 21:10 被阅读0次

1.tkinter

2.pyqt4

sudo apt-get install python-qt4

monkey-studio

apt-get install pyqt4-dev-tools qt4-designer

pyuic4 -x project.ui -o project.py

关键的例子:

from PyQt4 import uic

( Ui_MainWindow, QMainWindow ) = uic.loadUiType( 'mainwindow.ui' )

class MainWindow ( QMainWindow ):

"""MainWindow inherits QMainWindow"""

def pushButton_click(self):

self.ui.pushButton.setText("ok")

def __init__ ( self, parent = None ):

QMainWindow.__init__( self, parent )

self.ui = Ui_MainWindow()

self.ui.setupUi( self )

self.ui.pushButton.clicked.connect(self.pushButton_click)

def __del__ ( self ):

self.ui = None

树梅派的分辨率

3.5寸:480*320

7 寸800*480

10寸1280*800

https://github.com/makeabignews/show_ip_for_pi_gui

相关文章

网友评论

      本文标题:树梅派中的GUI编程

      本文链接:https://www.haomeiwen.com/subject/twbomxtx.html