.pyc files...

Jorgen Grahn jgrahn-nntq at algonet.se
Tue Nov 16 19:24:08 CET 2004


On Sun, 14 Nov 2004 16:48:51 -0600, Mike Meyer <mwm at mired.org> wrote:
> "Simon John" <simoninusa2001 at yahoo.co.uk> writes:
> 
>> Stephen Waterbury wrote:
>>
>>> > OK, stupid question, but it's been bothering me for ages.. J
>>> >
>>> > I love Python to bits, but .pyc files always litter my source tree,
>> and
>>> > they've always bothered me. ...
>>
>>> One solution (on unices, at least):
>>>
>>> alias cleanpy="find . -name '*.pyc' -exec rm {} ';'"
>> or with backticks:  rm -rf `find . -name '*.pyc'`
> 
> Better with $(: rm -rf $(find . -name '*.pyc').

Yeah, but then you're bash-specific.  Or at least that rules sh, csh and
tcsh.

My weapon of choice would be
  find . -name '*.pyc' | xargs rm
but on the other hand .pyc files don't bother me much ...

/Jorgen
(who wonders if the OP really was on a Unix system)

-- 
  // Jorgen Grahn <jgrahn@       Ph'nglui mglw'nafh Cthulhu
\X/                algonet.se>   R'lyeh wgah'nagl fhtagn!



More information about the Python-list mailing list