16.01.2014 Views

Beginning Python - From Novice to Professional

Beginning Python - From Novice to Professional

Beginning Python - From Novice to Professional

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

498 CHAPTER 26 ■ PROJECT 7: YOUR OWN BULLETIN BOARD<br />

Further Exploration<br />

Now that you have the power <strong>to</strong> develop huge and powerful Web applications with reliable and<br />

efficient s<strong>to</strong>rage, there are lots of things you can sink your teeth in<strong>to</strong>:<br />

• How about making a Web front-end <strong>to</strong> a database of your favorite Monty <strong>Python</strong> sketches?<br />

• If you’re interested in improving the system in this chapter, you should think about<br />

abstraction. How about creating a utility module with a function <strong>to</strong> print a standard<br />

header and another <strong>to</strong> print a standard footer? That way you wouldn’t have <strong>to</strong> write the<br />

same HTML stuff in each script. Also, it might be useful <strong>to</strong> add a user database with some<br />

password handling or abstract away the code for creating a connection.<br />

• If you’d like a s<strong>to</strong>rage solution that doesn’t require a dedicated server, you could use<br />

SQLite (which is used in Chapter 13), or you might want <strong>to</strong> check out Metakit, a really<br />

neat little database package that also lets you s<strong>to</strong>re an entire database in a single file<br />

(http://equi4.com/metakit/python.html).<br />

• Yet another alternative is the Berkeley DB (http://www.sleepycat.com), which is quite<br />

simple but can handle as<strong>to</strong>nishing amounts of data very efficiently. (The Berkeley DB is<br />

accessible, when installed, through the standard library modules bsddb, dbhash, and anydbm.)<br />

What Now?<br />

If you think writing your own discussion forum software is cool, how about writing your own<br />

peer-<strong>to</strong>-peer file sharing program, like Napster or BitTorrent? Well, in the next project, that’s<br />

exactly what you’ll do—and the good news is that it will be easier than most of the network<br />

programming you’ve done so far, thanks <strong>to</strong> the wonder of remote procedure calls.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!