1 #! /usr/local/bin/python
3 # www2.py -- print the contents of a URL on stdout
11 if len(sys
.argv
) != 2 or sys
.argv
[1][:1] == '-':
12 print "Usage:", sys
.argv
[0], "url"
19 sys
.stdout
.write(line
)
23 fp
= urllib
.urlopen(url
)
26 if type(msg
) == types
.TupleType
and len(msg
) == 4:
29 for line
in m
.headers
:
30 sys
.stdout
.write(line
)