Photo Booth Code

I’ve gotten a few questions about my Photo Booth, so I thought I would post more of the code to GitHib and explain it a bit. First, the code is here:

The main program is When the Raspberry Pi first boots up, it immediately runs this script. As in typical tkinter Python class style, all of the methods are defined first, and then an object is instantiated at the end with a call to root.mainloop() to get the GUI running.

I used several tkinter frames as the GUI interface, many of which contained JPGs of pictures I drew with instructions to guide the user. The constructor _init_ method defines all of the frames and the JPGs to use. When a frame selected, that frame gets a .lift() and a .update() to get the GUI to immediately update.

The flow of the GUI goes like this:

1. Start Screen. This is the default screen that initially comes up as well when the GUI times out.
2. Instruction Screen. Once the user touches the screen to initiate the process, the instruction screen explains what is going to happen and how it works.
3. Preview Screen. The GUI takes pictures and continuously shows what is taken so that the user can make sure the pictures look good before they are officially taken.
4. 3-2-1. The GUI counts down to give the user a chance to get ready. The LEDs change colors with each count.
5. CHEESE. The camera takes a picture that will be saved.
6. Got it. The GUI tells the user a picture was taken and then the countdown start over until 3 pictures have been taken.
7. Look Screen. Each of the 3 recorded pictures are shown on the screen. The pictures are shown in buttons such that the user can replace any of the pictures by pushing on it.
8. Finish screen. Once the user pushes the print button, the finish screen has instructions to direct the user to pick up their printout.

I’ll explain the submodules in separate posts to keep this from getting too wordy.