Hardware Reference
In-Depth Information
Try out different search terms by passing in arguments. For example, type the following to
search for the hash tag RaspberryPi :
./twitter_tag_listen.py “#raspberrypi”
Note that you have to enclose the tag in quotes. This tells the command line to ignore the
special meaning that # has, and to pass it through to your program as part of the argument.
TIP
Wrapping Up
By now you should have your own animatronic, twittering soft toy. You've also seen the
advantages of breaking a program up into manageable parts and reusing other people's code.
Becoming a programmer is sometimes like being a plumber - it's about connecting up func-
tions, with data flowing between them. If you're struggling with your own program design,
try splitting it up into a set of smaller problems and keep splitting until all the problems are
really simple to code. Not only is it less daunting at the design stage, but by testing stage-by-
stage, it's harder for bugs to hide and easier for you to find them. When writing functions,
you've seen the need for good observability for testing and debugging - that is, you can see what
is going on inside them so you can check that they work and fix them when they don't!
You've also seen the need for good documentation. If other people are going to reuse your
code, then they need clear instructions about how to install the program, what other mod-
ules it depends on and what arguments each function takes and does.
Practically, you've also learned about using tar and untar for packaging up sets of files and
how to build and install Python modules.
There are lots of ways you can customise the twittering soft toy; why not try some of the
following suggestions? Don't forget to film what you make, upload it to YouTube and tag it with
Raspberry Pi Project Topic .
YOUR TURN!
More Ideas
here are many things you can do with your own toy. Here are some suggestions:
Try changing the arguments passed to espeak. (Don't forget that -h will give you a list
of options.) For example, you could try
Different languages
Different voices, both male and female
 
Search WWH ::




Custom Search