syntax question - if 1:print 'a';else:print 'b'

Gregory Piñero gregpinero at gmail.com
Thu Oct 27 14:00:58 EDT 2005


Not quite because if something(3) fails, I still want something(4) to run.


On 10/27/05, Micah Elliott <mde at micah.elliott.name> wrote:
>
>
>
> If you just want to ignore the exceptions while saving space/typing,
> you could equivalently do::
>
> try:
> something(1)
> something(2)
> # ...
> except:
> pass
>
> or::
>
> try:
> something(1); something(2); # ...
> except:
> pass
>
> or::
>
> try:
> for i in range(yourlimit):
> something(i)
> except:
> pass
>
> --
> _ _ ___
> |V|icah |- lliott http://micah.elliott.name mde at micah.elliott.name
> " " """
>



--
Gregory Piñero
Chief Innovation Officer
Blended Technologies
(www.blendedtechnologies.com <http://www.blendedtechnologies.com>)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20051027/6524e2ac/attachment.html>


More information about the Python-list mailing list