Most of the topics of this chapter are not really good topics for exercises without first covering the frameworks they cover. A couple of things can be done with the knowledge you already have, however:
Faking the Web. You may not have a web server
running, which makes using formletter.py
and
FormEditor.py
difficult, since they use data
generated by the CGI script. As an exercise, write a program that
creates files with the same properties as those created by the CGI
script.
Cleaning up. There’s
a serious problem with the formletter.py
program: namely, if, as we mention, it’s run nightly, any
complaint is going to cause a letter to be printed. That will happen
every night, since there is no mechanism for indicating that a letter
has been generated and that no more letters need be generated
regarding that specific complaint. Fix this problem.
Adding parametric plotting to
grapher.py. Modify
grapher.py
to allow the user to specify
expressions that return both x and y values, instead of the current
“just y” solution. For example, the user should be able
to write in the Expression
widget:
sin(x/3.1),cos(x/6.15)
(note the comma: this is a
tuple!) and get a picture like that shown in Figure 10.8.