The code
#!/usr/bin/env python import MySQLdb print \"Content-Type: text/html\" print print \"Books
The error in http://dpaste.com/8866/ is occurring because you are using "curly quotes" instead of standard ASCII quotation marks.
You'll want to replace the “ and ” with ". Just use find and replace in your text editor.