try:
file = open("/etc/password")
except IOError, (errno, message):
if errno == 2:
print "File does not exist, cannot open"
else:
print "Unhandled error", errno, message
[\code]
[tab]Some places to visit are [URL unfurl="true"]www.python.org[/URL] , [URL unfurl="true"]www.pythonlabs.com[/URL] , and [URL unfurl="true"]www.oreilly.com.[/URL] The latter has a place called O'Reilly Network. This has a lot of information about a lot of open source programs. There is a tutorial about Python by Jason Tackaberry there. The above code came from his tutorial.
James P. Cottingham
[URL unfurl="true"]www.ivcusa.com[/URL]
All opinions are mine alone and do not necessarily reflect those of my employer.