formella22
Posts: 1
Joined: Wed Jan 18, 2017 2:42 pm

Python GUI Interface

Wed Jan 18, 2017 3:10 pm

https://www.youtube.com/watch?v=Bvq0LdBn0dY

We created a program that runs similarly to the GUI in the video above using tkinter library and python. We want the program to start immediately after every start up, but are unsure how. The interface is at full screen right now with no access to the desktop or menu. We want the user to simply experience the interface and not have to open and run any code, with the exit button commanding the pi to shutdown. Changing rc.local and crontab hasn't given us any results, which could be an affect of us coding incorrectly. We are students learning this, so we would appreciate simple or step by step explanations if possible.

Thank you.

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Python GUI Interface

Wed Jan 18, 2017 3:54 pm

The Raspberry Pi Foundation documentation for those two options is here: https://www.raspberrypi.org/documentati ... /README.md

gkreidl
Posts: 6335
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Python GUI Interface

Wed Jan 18, 2017 4:39 pm

You will have to start X11 and probably a window manager as well.
If you want to start this (using a script) from rc.local, you have to use some tricks after the latest XORG updates.
viewtopic.php?f=66&t=168739

For simple, one page applications matchbox-window-manager (has to be installed) is a good choice. The "kiosk" script, mentioned in the above posting, might look like this:

Code: Select all

#!/bin/sh
matchbox-window-manager &
/path/to/yourapplication
sudo shutdown -h now
You must set your RPi to boot to the command line (not to the desktop!).
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Return to “Graphics programming”