We have seen how to run an application and access it with a web browser, now let's have a look at the Python code needed to accomplish this. We will need to serve static files but in addition to those static files we want to generate the main HTML content dynamically. This isn't strictly necessary as we could have served it as a static file just as easily but it serves as a simple example of how to generate dynamic content:
import cherrypy import os.path current_dir = os.path.dirname(os.path.abspath(__file__))
You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you ...