Xah Lee wrote:
> Dear Peter Hansen,
> My messages speak themselfs. You and your cohorts's stamping of it does
> not change its nature. And if this is done with repetitiousness, it
> gives away your nature.
Taunt not the cohorts of Peter Hansen!
Graham
--
http://mail.python.org/mailman/listinfo/
On Wed, 19 Oct 2005 11:48:01 +0200, Xah Lee <[EMAIL PROTECTED]> wrote:
> Thanks a lot for various notes. Bonono?
>
> I will have to look at the itertools module. Just went to the doc
> http://www.python.org/doc/2.4.1/lib/module-itertools.html
> looks interesting.
>
>> But I believe Python is desig
Xah Lee wrote:
>Peter Hansen wrote:
>
>
>>Xah Lee wrote:
>>
>>
>>>If you think i have a point, ...
>>>
>>>
>>You have neither that, nor a clue.
>>
>>
>
>Dear Peter Hansen,
>
>My messages speak themselfs. You and your cohorts's stamping of it does
>not change its nature. And if this
Xah Lee wrote:
> This i'm not sure. Of the past couple of years i increasingly developed
> a theory (probably well-known among proper experts), that the
> difficulty of human feats of various forms, are primarily a perception
> and familiarity thing. This may be getting off topic, but i wrote an
>
Thanks a lot for various notes. Bonono?
I will have to look at the itertools module. Just went to the doc
http://www.python.org/doc/2.4.1/lib/module-itertools.html
looks interesting.
> But I believe Python is designed for easy to code and read and maintain
> in mind.
> One has to admit that with
Xah Lee wrote:
> besides syntactical issues, another thing with doing functional
> programing in imperative languages is that they become very inefficent.
> Functional languages are optimized by various means of functional
> programings styles. Doing them in imperative languages usually comes
> wi
[EMAIL PROTECTED] wrote:
> it will be added in 2.5 I beleve. At the moment, you can:
>
> predicate and or
Ah, i see. Here's the full code again:
# -*- coding: utf-8 -*-
# python
import re, os.path
imgPaths=[u'/Users/t/t4/oh/DSCN2059m-s.jpg',
u'/Users/t/t4/oh/DSCN2062m-s.jpg', u'/Users/t/t4/o
it will be added in 2.5 I beleve. At the moment, you can:
predicate and or
like :
>>> os.paths.exists(something) and "print it is there" or "file not found"
I am practicing FP in python and it is in general doable with the help
of itertools and add the needed functions as needed, like scanl/sc
Thanks. Here's how the inner loop should be:
imgPaths2=map(lambda x: (x, re.sub( r"^(.+?)-s(\.[^.]+)$",r"\1\2", x)),
imgPaths)
though, now i just need something like
map( lambda x: os.path.exists(s)? x[1]:x[0],impPaths2)
but Pyhton doesn't support the
test ? trueResult : falseResult
construct.
what do you mean by one line ? Using map/filter, I believe it is
possible.
Somthing like:
map(lambda (s,f): os.path.exists(f) and f or s,
map(lambda x: (x, re.replace(x, "-s","")), imgPaths)
My regex is a bit rusty but I hope you got the idea of what I am trying
to do. If there is a way to m
Peter Hansen wrote:
> Xah Lee wrote:
> > If you think i have a point, ...
>
> You have neither that, nor a clue.
Dear Peter Hansen,
My messages speak themselfs. You and your cohorts's stamping of it does
not change its nature. And if this is done with repetitiousness, it
gives away your nature.
Xah Lee wrote:
> If you think i have a point, ...
You have neither that, nor a clue.
(Newsgroups line trimmed to reduce the effects of cross-posting trolls.)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
Xah Lee wrote:
> is there a way to condense the following loop into one line?
>
> # -*- coding: utf-8 -*-
> # python
>
> import re, os.path
>
> imgPaths=[u'/Users/t/web/Periodic_dosage_dir/lanci/t4/oh/DSCN2059m-s.jpg',
> u'/Users/t/web/Periodic_dosage_dir/lanci/t4/oh/DSCN2062m-s.jpg',
> u'/Users/t
On 18 Oct 2005 14:56:32 -0700, Xah Lee <[EMAIL PROTECTED]> wrote:
>is there a way to condense the following loop into one line?
There is.
exec('696d706f72742072652c206f732e706174680a0a696d6750617468733d5b75272f55736572732f742f7765622f506572696f6469635f646f736167655f6469722f6c616e63692f74342f6f682
is there a way to condense the following loop into one line?
# -*- coding: utf-8 -*-
# python
import re, os.path
imgPaths=[u'/Users/t/web/Periodic_dosage_dir/lanci/t4/oh/DSCN2059m-s.jpg',
u'/Users/t/web/Periodic_dosage_dir/lanci/t4/oh/DSCN2062m-s.jpg',
u'/Users/t/web/Periodic_dosage_dir/lanci/t4
15 matches
Mail list logo