Skip to content

alejandrodlsp/Trivia-question-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Trivia-question-loader

By alejandro de los Santos. alejandrodlsp.com

A python script that loads trivia questions from https://opentdb.com/ API and deserializes them into objects for easy use. It makes use of session tokens to make sure questions are not repeated.

Example usage of script:

# import question loader script
import questionLoader                                                      
# create a new question set
question_set = questionLoader.question_set("10","9","medium","multiple")
# get list of questions from question set
questions = question_set.get()                                             

# loop trough questions in the questions list
for i in range(0,len(questions)):                                           
	print(questions[i].question)                                              

About

A python script that loads trivia questions from https://opentdb.com/ and deserializes them into objects for easy use.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages