Example 1, placed in ‘example.py’:
#!/usr/bin/env python
print 'hello, world'
Example 2:
import socket
Example 3:
while "foo":
print 'hello, world'
Example 4:
while "":
print 'hello, world'
This file can be edited directly through the Web. Anyone can update and fix errors in this document with few clicks -- no downloads needed.
For an introduction to the documentation format please see the reST primer.