How can handle exception?

Mark McEahern marklists at mceahern.com
Sat Jan 5 16:34:52 CET 2002


Ladislav:
> Hello,
> My program sometimes raise the exception
> 
> socket.error: (10061, 'Connection refused')
> 
> How can I handle this kind of exception?

try:
	# your code that's failing
except:
	# what you want to do when it fails

// mark





More information about the Python-list mailing list