Steve Holden wrote:
>> On Thu, 2005-10-27 at 14:00, Gregory Piñero wrote:
>>
>>> Not quite because if something(3) fails, I still want something(4) to
>>> run.
> Then the obvious extension:
>
> for i in range(20):
>...
>
> but I get the idea that Gregory was thinking of different statement
On Thursday 27 October 2005 11:16, Carsten Haese wrote:
> On Thu, 2005-10-27 at 14:00, Gregory Piñero wrote:
> > Not quite because if something(3) fails, I still want something(4) to
> > run.
>
> def something_ignore_exceptions(x):
> try: something(x)
> except: pass
>
> something_ignore_excepti
Carsten Haese wrote:
> On Thu, 2005-10-27 at 14:00, Gregory Piñero wrote:
>
>>Not quite because if something(3) fails, I still want something(4) to
>>run.
>
>
> def something_ignore_exceptions(x):
> try: something(x)
> except: pass
>
> something_ignore_exceptions(1)
> something_ignore_exc
On Thu, 2005-10-27 at 14:00, Gregory Piñero wrote:
> Not quite because if something(3) fails, I still want something(4) to
> run.
def something_ignore_exceptions(x):
try: something(x)
except: pass
something_ignore_exceptions(1)
something_ignore_exceptions(2)
# etc...
HTH,
Carsten Haese
Not quite because if something(3) fails, I still want something(4) to run.
On 10/27/05, Micah Elliott <[EMAIL PROTECTED]> wrote:
If you just want to ignore the exceptions while saving space/typing,you could equivalently do::try:something(1)something(2)# ...except:
On Oct 27, Gregory Piñero wrote:
>
>my goal really was to do:
>try:something(1);except:pass
>try:something(2);except:pass
>try:something(3);except:pass
>...
>for about 20 lines.
If you just want to ignore the exceptions while saving space/typing,
you could equivalently do:
That's interesting, Simon. However, my goal really was to do:
try:something(1);except:pass
try:something(2);except:pass
try:something(3);except:pass
...
for about 20 lines.
I figured this would be more readable because if I reader sees 20 lines
of nearly identical text he'll understand that it
On 27/10/05, Gregory Piñero <[EMAIL PROTECTED]> wrote:
> So much for writing my whole program on one line :-(
http://www.unixuser.org/~euske/pyone/
But you didn't hear it from me, OK? ;-)
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/
Gregory Piñero wrote:
> So much for writing my whole program on one line :-(
Why bother with one liners?
"The number of meaningful lines and pages a writer produces is a
measure for his writer-ship"
-- my old Literature professor
--
http://mail.python.org/mailman/listinfo/python-list
So much for writing my whole program on one line :-(
j/k
-GregOn 10/26/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
Gregory Piñero wrote:> Any idea why I can't say:>> if 1:print 'a';else:print 'b'>> all in one line like that?because ";" can only be used to separate simple statements, not
the diff
Gregory Piñero wrote:
> Any idea why I can't say:
>
> if 1:print 'a';else:print 'b'
>
> all in one line like that?
because ";" can only be used to separate simple statements, not
the different parts in a compound statement.
see the grammar for details:
http://docs.python.org/ref/grammar.txt
11 matches
Mail list logo