Does Python seem appropriate for me?

Tim Peters tim.one at home.com
Sun Apr 22 15:46:00 EDT 2001


In the grand Usenet tradition, I'm delighted to see this thread mushroom out
of its most trivial point <wink>.  Ironically, and even skipping the zsh
variations, I can't imagine *anything* that would better drive home the point
to the original poster that "the littlest things will drive him mad" when he
first wakes up inside the Unix zoo.  Believe it or not, he's going to spend
the first hour of his life searching the ls man page in vain (which, for the
convenience of the user, probably won't mention "find" at all).

flamers-should-read-the-original-msg-before-going-nuts-ly y'rs  - tim


>>> the littlest things will drive you mad.  Trivial example:  say you use
>>>
>>>    dir/s *.py
>>>
>>> today to find all the .py files in the subtree rooted at the current
>>> directory.  You're not going to *believe* the hoops you have to
>>> jump through to get that done under a Unix shell instead.

>> Find all .py files in the subtree at the current directory:
>>
>> % find . -name "*.py" -print

> Or, if you are using a *real* "find" (i.e., Gnu find, which is what
> Linux comes with), just
>
>    % find -name "*.py"
>
>> Find all .py files in the subtree at the current directory,
>> which also contain the word "import":
>
>> % find . -name "*.py" -exec grep import {} \; -print
>
> This will be faster and easier to type:
>
>    % find -name "*.py" | xargs grep import





More information about the Python-list mailing list