You are on page 1of 4

Unelte GUI pentru Python raspberry pi gui programming

One of the more interesting projects, the liberal MIT-licensed Kivy is based on OpenGL ES 2
and includes native multi-touch for each platform and Android/iOS. Its an event-driven
framework based around a main loop, and is thus very suitable for game development. Your
application adds callbacks from the main loop at a scheduled frequency, or by one-off trigger.
The Kivy framework is very powerful for handling everything from widgets to animation, and
includes its own language for describing user interface and interactions.
If you want to create cross-platform graphical applications, or just need a very powerful crossplatform GUI, Kivy is highly recommended.

Qt is a multi-licensed cross-platform framework written in C++. If your application is
completely open source, you can use Qt for free under the community license; otherwise youll
need a commercial license. Qt has been around for a long time and was owned by Nokia for a
while; its a very comprehensive library of tools and APIs, widely used in many industries, and
covers many platforms including mobile. If a gadget such as a SatNav has a GUI, theres a good
chance itll be Qt based.

Compared to Kivy and PyQt, PyGUI is considerably simpler and just for Unix, Macintosh and
Windows platforms. Developed by Dr. Greg Ewing at the University of Canterbury in New
Zealand, the MVC framework focuses on fitting into the Python ecosystem as easily as possible.
One of the platforms aims is to interpose as little code as possible between the Python
application and the platforms underlying GUI so the applications display always reflects the
native GUI of the platform. If youre after a simple and quick way to learn GUI, start with this
Not listed there is TkInter, which is the most used Python toolkit. If you have Python running on
your system, you have TkInter. I decided not to use it though because the widgets have a very
dated look to them.
The other toolkit I considered was wxPython. The UI widgets have a modern feel, though they
not entirely native looking. Also plenty of documentation exists. However, I had some trouble
getting wxGlade running, which is a WYSIWYG GUI editor.
This lead me to Qt. PyQt is available as GPL or Commercial License while Qt
is available under LGPL or Commercial license dar free ca necomervial.
pure open source, then you might be happier with wxPython.
I wanted to use my laptop for development and then deploy the code to my Pi
when done.
sudo apt-get install python3 python3-pyqt5

On the PC you plan to develop from, download and install QtCreator. You can
download that from Qt,
I think getting python3, Qt5, and PyQt5 installed is the hardest part.
Making a GUI in QtCreator. Start a new project in QtCreator and select Desktop

Python, generaliti
l folosesc pentr mdiul grafic, pentru camer, pentru c sunt multe exemple
pentru raspberry Pi

Using third-party tools, such as Py2exe or Pyinstaller,[30] Python code can be

packaged into stand-alone executable programs for some of the most popular
operating systems, so Python-based software can be distributed to, and used on,
those environments with no need to install a Python interpreter.
wget O
sudo python

BCM = schema de numerotare

Cleanup = toi pinii input

Pentru intarzieri:
Import time
Pentru buton:
Import os, se pot rula comenzi din OS
while True:


= trimite comanda

optiune=input(Introdu operatia: )
while n<11:
n shell ls l mi d date despre fiiere
Interfa cu un senzor 1-Wire
Citire fiier
if a==1 and b==3

! Python programming for Raspberry Pi Blum.pdf

La literalele sir se pot folosi si si
>>> print ("This example protects the output's single quote.")
>>> print ('I said, "I need to protect my quotation!" and did so.')
Pot sa include si trecerea la rand nou
Using Triple Quotes
>>> print ("""This is line one.
... This is line two.
... This is line three.""")
>>> print ("""Raz said, "I didn't know about triple quotes!" and laughed.""")
Accept secvene Escape.
nu are variabile, ci numai obiecte
Conteaz litera mare / mic
Tipuri de dat: float, int, long, str
Citire: var = input (mesaj)

Python GUI Tkinter

Tkinter is a Python binding to the Tk GUI toolkit. It is the standard Python interface to the Tk
GUI toolkit,[1] and is Python's de facto standard GUI.[2] Tkinter is included with the standard
Microsoft Windows and Mac OS X install of Python.
The name Tkinter comes from Tk interface. Tkinter was written by Fredrik Lundh.

popular GUI library alternatives available, such as wxPython, PyQt (PySide),

Pygame, Pyglet, and PyGTK.

Instalare Open CV 3
sudo apt-get update
sudo apt-get upgrade
We then need to install some developer tools, including CMake, which helps us
configure the OpenCV build process:
sudo apt-get install build-essential cmake pkg-config
sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev

sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev

$ sudo apt-get install libxvidcore-dev libx264-dev
sudo apt-get install libgtk2.0-dev
sudo apt-get install libatlas-base-dev gfortran

cd ~
$ wget -O
$ unzip
$ sudo python
sudo pip install virtualenv virtualenvwrapper
$ sudo rm -rf ~/.cache/pip
# virtualenv and virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/
$ source ~/.profile
mkvirtualenv cv -p python2
mkvirtualenv cv -p python3

source ~/.profile
$ workon cv
pip install numpy