repo.or.cz
/
pylit.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Update stylesheet to work with the new standard "code" directive.
[pylit.git]
/
rstdocs
/
tutorial
/
hello_with_doctest.py.txt
blob
0a253cc72cc487e86722201f4fd5676a675f3cc2
1
The classical programming example in Python
2
will print a familiar greeting:
3
4
>>> greeting()
5
Hello world
6
7
::
8
9
def greeting():
10
print "Hello world."
11
12
run doctests if called from the command line::
13
14
if __name__ == "__main__":
15
import doctest
16
doctest.testmod()