Feb 04
I ran into this module and just thought it was cool so I thought I would mention it here. Python has a few modules for working with processing URL’s and using ftp. So you could create a tool that you share with the public and have it read a URL which would allow you to dynamically create start up messages or even tell the user that the tool has been updated. Ahhhh.. that could get scary.
import urllib2
# Open the URL for reading
urlFile = urllib2.urlopen('http://www.rtrowbridge.com/blog/about/')
# Get info abou the URL
urlFile.info()
# Read the URL source code
for line in urlFile:
try:
print line
except:
pass
Cheers,
-RyanT
Recent Comments