Python in Bigger Projects

Laura Cassell, Alan Gauld · 2014

This chapter teaches the reader how to test his Python code, debug the code, and handle errors in the code. The simplest form of testing in Python is the doctest module. This module is made for testing the simpler parts of your code, to verify that it will function as expected, as written in your document strings (triple quotes “…” or “…”, single or double quotes will both work). The chapter provides a brief introduction of test-driven development (TDD) to familiarize the reader with the term. Python makes debugging a little less of a hassle with the Python debugger module, or the pdb. The chapter also discusses structuring and releasing the Python code and tuning the performance of the code. Virtualenv is a virtual environment for your Python projects. It enables you to create numerous Python instances and develop against all the libraries you need for certain projects.

Read the paper · More papers on PaperTik