summaryrefslogtreecommitdiff
path: root/web/noweb/contrib/fischer/noscript-0.1/test-py.nw
blob: 113b5a8e0f8b9950df84bcd9b4fed86418082a96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
%!/usr/bin/env python

@ This is a test script which displays the ability of my new noweb-script to
actually execute a script which is embedded in a noweb styled file.

<<*>>=
<<imports>>

print "Hello Python World!"
print "Args:", sys.argv[1:]
for n in xrange( 0, 10 ):
   <<Do something with numbers>>
print

@ And that should do it, now we just need to do something with the numbers:

<<Do something with numbers>>=
print n,

@ Oh yeah, I need to import [[sys]] as well

<<imports>>=
import sys