1 #! /usr/local/bin/python
3 # www4.py -- display the contents of a URL in a Text widget
10 if len(sys
.argv
) != 2 or sys
.argv
[1][:1] == '-':
11 print "Usage:", sys
.argv
[0], "url"
14 fp
= urllib
.urlopen(url
)
16 text
= Text() # Create text widget
17 text
.pack() # Realize it
22 text
.insert('end', line
) # Append line to text widget
24 text
.mainloop() # Start Tk main loop