On 6月26日, 下午11时07分, Colin Walters <
cgwalt...@gmail.com> wrote:
> Right, the result of "ls" is going to be some subclass of File. So
> what you want to do here is:
>
> ls *.txt | prop path | apply cat
>
Thank you. But I still have not get the "-n 1" option. For xargs "-n
1" means it will call "cat" multiple times, each time with one
argument (one word) from the pipe. Suppose we substitute "cat" with
some other program that accepts just one argument, the result is
different with/without "-n 1".
BTW, map(lambda x: cat(x.path), ls("*.txt")) looks much natural to me,
especially the 'x.path' part. I think I partly understand why it is
not done this way in Hotwire.