Fix the HTML tarball target to generate the HTML if needed instead of
[python/dscho.git] / Demo / tkinter / www / www1.py
blob558fd740f3abe9ec61c889d333d003f7fb8aba85
1 #! /usr/bin/env python
3 # www1.py -- print the contents of a URL on stdout
5 import sys
6 import urllib
8 def main():
9 if len(sys.argv) != 2 or sys.argv[1][:1] == '-':
10 print "Usage:", sys.argv[0], "url"
11 sys.exit(2)
12 url = sys.argv[1]
13 fp = urllib.urlopen(url)
14 while 1:
15 line = fp.readline()
16 if not line: break
17 print line,
19 main()