- Basic trivia program developed with python
- Designed for a display screen, control screen, and controller input
- See
src/files/help.txtfor more information on how to play
spykian@gmail.com is the original creator of this program, I have only helped to maintain it to be compatible with modern libraries.
- Source code located in the
srcfolder - Program can be run from any of the code files instead of executable
sample_questionscan be used for debugging
See requirements.txt
Most of the code involves tkinter, so you should get familiar with that first.
- The entire app and main screen is run by the Tk object (you can only have one)
- Each additional window is run by the Toplevel object
- Each page is a frame that is attached to the window
- Frames are switched with the tkraise method
- Items in each page must by positioned in the page to show up (via pack or grid)
- In order for the app to run, update and update_idletasks methods must be called on the Tk object
- If you have a loop running, you need both to be called to update screens and get user input
Turning this into an executable is a pain. Thankfully, I found the needed workaround already.
- Open command prompt in the the
srcfolder - Run
pyinstaller TriviaProgram.spec- If that does not work try
python -m PyInstaller TriviaProgram.spec
- If that does not work try
- Wait for it to finish (~5 minutes)
- Copy the executable from the
distfolder to the top level root folder- The .exe looks for the sounds, logs, and other files it needs to run in the
filesfolder in its current directory, which is why we have to move it to the root folder
- The .exe looks for the sounds, logs, and other files it needs to run in the
- You can then delete the
dist,build, and__pycache__folders
If you do not like the default sounds that play during the game, you can use your own custom sounds by adding them to the files/sounds folder. Sounds are chosen by the game randomly, so if you want only your own custom sounds to play you can remove all but your own sounds.
alarm: plays when time has run out on a questioncorrect: plays when a player answers a question correctlyding: plays when a player buzzes inincorrect: plays when a player answers a question incorrectly
To change the icon, replace the icon.ico file in the misc folder.