Subscribe
Tutorial search

Python: Using doctest for Documentation - Python tutorial


Python provides the useful ability to embed comments inside functions that are accessible from a Python shell. These are known as docstrings. A docstring provides the ability to embed not only information, but also code samples that are runnable.In this article, we will explore different ways to use doctest to develop documentation. In this article by Greg Lee Turnquist, author of Python Testing Cookbook, we will cover: •Documenting the basics •Catching stack traces •Running doctests from the command line •Printing out all your documentation including a status report
Category: Python tutorials - Difficulty:


More cool Python tutorials:



Tips for readable python code
Tips for readable python code
In this post I will try to explain some tricks I use to make python code more readable. These tips won’t make your code shorter and it won’t be better optimized, it will actually use more memory than before, but it will be much easier to understand and edit for someone else.
Difficulty:
Introducing the JyDT Plug-in for Eclipse
Introducing the JyDT Plug-in for Eclipse
The JyDT plug-in enables Eclipse to work as a Jython/CPython IDE. In this tutorial learn how to configure the JyDT and a brief description of it. Learn to use the PyDev perspective and explorer, compile and run code, use the debugger, do unit testing, refactor, manage Python projects, and use the editor and IDE.
Difficulty:
Learning Python part 1 (Getting started and first program)
Learning Python part 1 (Getting started and first program)
part 1 Getting started and first program Installing python: To get started on using python you have to install an interpreter....
Difficulty:
[python] tic-tac-toe
[python] tic-tac-toe
I've been reading a book about cryptography recently. The book in question is "The Code Book - A Secret History of Codes and Code-Breaking" by Simon Singh (Amazon link). While there is no programming content in the book it covers the ideas needed to be able to come up with your own programs.
Difficulty:
Python 201 -- (Slightly) Advanced Python Topics
Python 201 -- (Slightly) Advanced Python Topics
This document is a syllabus for a second course in Python programming. This course contains discussions of several advanced topics that are of interest to Python programmers.
Difficulty: