树梅派中的GUI编程

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编程)