Hardware Reference
In-Depth Information
3. The next step is to iniialize the Wordnik API and retrieve the word of the day:
words = WordsApi.WordsApi(client)
example = words.getWordOfTheDay()
4. The returned object is a WordOfTheDay object ( https://github.com/
wordnik/wordnik-python/blob/master/wordnik/models/WordOfTheDay.
py ). Let's print the word, deiniion, and the published date:
string = 'The Word of the Day is ' + example.word +'.'
print string
string = 'Definition: '+example.definitions[0].text
print string
string = 'Date = '+example.publishDate.strftime("%D")
print string
5.
The output of this Python script is something like the one shown here:
The Word of the Day is asportation.
Definition: The felonious removal of goods from the place where
they were deposited.
Date = 01/19/15
6. Now, this word of the day can be displayed on a screen at some prominent locaion
using a GUI tool such a s Tkinter ( http://zetcode.com/ gui/tkinter/ ) and
updated every 24 hours. Refer to this topic's website for some ideas.
Objective complete - mini debriefing
In this task, we reviewed an example of how to use your Raspberry Pi for self-improvement;
similarly, there are APIs from other sources that provide a quote of the day, joke of the day,
and so on.
Raspberry Pi and Khan Academy
In this task, we will review an example that enables working on math exercises from K han
Academy ( https://www.kha nacademy.org/ ). Khan Academy is a non-proit educaional
organizaion that provides free learning resources for various subjects, including math and
computer science. In this example, we will host a simple web server on a Raspberry Pi that
hosts the exercises from Khan Academy locally. This enables customizaion of the learning
tools to the user's needs. For example, it can be hosted on a network that is not connected to
the Internet and we can customize content from Khan Academy to help someone improve on
their math skills.
The first step is to clone the repository on a Raspberry Pi:
git clone https://github.com/Khan /khan-exercises
 
Search WWH ::




Custom Search