"mwt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > In my latest attempt at some Python code, I've been tempted to write > something in the form of: > > try: > [...] #doing some internet stuff > except IOError: > alternate_method_that_doesnt_need_internet() > I'm only a hack at programming but where I find try: blocks useful is where I have multiple statements within the try: block, any one or more of which can produce an exception. I just want to trap a failure and get out of there. This happens to me for any number of reasons when I drive other apps through the com interface. (In my job I just write simple apps to make my job easier, not bomb-proof customer-focused code). So in your case perhaps you have open connection, find site, get data within the try block, and exit gracefully if any one fails. How you use it depends on what level of detail you need.
bwaha -- http://mail.python.org/mailman/listinfo/python-list