Mr.SpOOn:
> try:
>     m = re.match('[1-9]$', my_string)
> except:
>     print 'something...'
> ...
> try:
>    m.group()
> except:
>    print 'error...'

Generally don't write a nude except, use qualified exceptions, that is
put there one of more exceptions that you want to catch (be careful
with the syntax with more than one exception, see the docs).

Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to