Skip to content

A basic quiz app created in python, using tkinter, with questions supplied by the Open Trivia Database (opentdb.com)

License

Notifications You must be signed in to change notification settings

multi-vit/python-gui-quiz-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-gui-quiz-app

A basic quiz app created in python, with questions supplied by the Open Trivia Database (opentdb.com).

Demonstration

Gif demonstrating the quiz app

Python has introduced me to the OOP(Object Oriented Programming) paradigm, which I've only briefly touched upon during my journey with JavaScript.

Learnings from completing this project

  • Calling an API (opentdb.com)
  • Class-based programming
  • Separation of concerns - maintaing pure functionality
  • Using Tk Interface to:
    • Create a canvas
    • Draw question text on it
    • Use a grid layout
    • Display images for true/false answers
    • Update the display background to confirm whether the user answers correctly

Challenges faced

  • Once I had completed the quiz logic in main.py, it was a big challenge to then be able to abstract it, whilst still ensuring all the components talked to each other.
  • Navigating the data received from the API
  • Creating the layout in tkinter can be fiddly

Using the app

Clone down the folder from GitHub into your IDE. Change directory in to the root folder. You will need to install the requests module as it does not come pre-bundled with python. For PyCharm, see here. In VS Code, enter this command at the root level of the project:

pip3 install requests

Then run main.py.

About

A basic quiz app created in python, using tkinter, with questions supplied by the Open Trivia Database (opentdb.com)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages