[EMAIL PROTECTED] wrote:
> My "print" line is actually a long 40 line block.
and? if your editor isn't horribly broken, that shouldn't be much
of a problem.
(but you may want to refactor the code; if you have a processing
block that large, it's probably better to move all or parts of it
into a
Tim Williams wrote:
> Maybe
>
def myfunc(txt):
> ... print txt
> ...
datafiles = ['1.txt','2.txt','3.txt','4.tst']
null = [myfunc(i) for i in datafiles if '.txt' in i]
> 1.txt
> 2.txt
> 3.txt
Ew. List comprehensions with side effects are very icky.
--
http://mail.python.or
Fredrik Lundh wrote:
[snip]
> probably. but unless your editor or keyboard is horribly broken, you
> can of course press return at the right place instead:
>
>for i in datafiles:
> if '.txt' in i:
> print 'Processing datafile %s' % f
>
> (for this specific case, "endswi
[EMAIL PROTECTED] wrote:
> I found myself writing:
>
> for f in [i for i in datafiles if '.txt' in i]:
> print 'Processing datafile %s' % f
>
> but I was wishing that I could have instead written:
>
> for f in in datafiles if '.txt' in f:
> print 'Processing datafile %s' % f
>
> Has there
[EMAIL PROTECTED] wrote:
> I found myself writing:
>
> for f in [i for i in datafiles if '.txt' in i]:
> print 'Processing datafile %s' % f
>
> but I was wishing that I could have instead written:
>
> for f in in datafiles if '.txt' in f:
> print 'Processing datafile %s' % f
>
> Has th
On 3 Oct 2006 10:50:04 -0700, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> I found myself writing:
>
> for f in [i for i in datafiles if '.txt' in i]:
> print 'Processing datafile %s' % f
>
> but I was wishing that I could have instead written:
>
> for f in in datafiles if '.txt' in f:
>
On Tuesday 03 October 2006 19:50, [EMAIL PROTECTED] wrote:
> I found myself writing:
>
> for f in [i for i in datafiles if '.txt' in i]:
> print 'Processing datafile %s' % f
>
> but I was wishing that I could have instead written:
>
> for f in in datafiles if '.txt' in f:
> print 'Processin