Book Image

Python 3 Web Development Beginner's Guide

By : Michel Anders
Book Image

Python 3 Web Development Beginner's Guide

By: Michel Anders

Overview of this book

<p>Building your own Python web applications provides you with the opportunity to have great functionality, with no restrictions. However, creating web applications with Python is not straightforward. Coupled with learning a new skill of developing web applications, you would normally have to learn how to work with a framework as well.</p> <p><em>Python 3 Web Development Beginner's Guide</em> shows you how to independently build your own web application that is easy to use, performs smoothly, and is themed to your taste – all without having to learn another web framework.</p> <p>Web development can take time and is often fiddly to get right. This book will show you how to design and implement a complex program from start to finish. Each chapter looks at a different type of web application, meaning that you will learn about a wide variety of features and how to add them to your custom web application. You will also learn to implement jQuery into your web application to give it extra functionality. By using the right combination of a wide range of tools, you can have a fully functional, complex web application up and running in no time.</p>
Table of Contents (19 chapters)
Python 3 Web Development Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – converting a unit convertor into a plugin


Re-using one of the many well designed jQuery UI widgets is good as it saves us development and maintenance time but the true power of the jQuery UI framework is the manner in which it enables us to devise completely new widgets that merge seamlessly with the rest of the framework and are indistinguishable in their use from the standard widgets. To illustrate what is possible, let's implement our unit converter again, but this time as a jQuery plugin:

  1. Go to the directory containing the example code for Chapter 2.

  2. Double-click the file unitconverter2.py, the CherryPy console will again open in a window.

  3. Enter http://localhost:8080 in the address bar of your browser (or click refresh if it is still open on that address). You will now see a slightly restyled unit converter:

The interaction with this new unit converter is exactly the same as our previous one.

What just happened?

Instead of structuring a widget with a <form> element...