.pyc files...

Reinhold Birkenfeld reinhold-birkenfeld-nospam at wolke7.net
Sun Nov 14 19:56:20 CET 2004


Alex Martelli wrote:
> Reinhold Birkenfeld <reinhold-birkenfeld-nospam at wolke7.net> wrote:
> 
>> >> alias cleanpy="find . -name '*.pyc' -exec rm {} ';'"
>> > or with backticks:  rm -rf `find . -name '*.pyc'`
>> 
>> Beware of spaces in filenames!
> 
> Yeah, but it's pretty unlikely, though not impossible, to have a .pyc
> file, specifically, with spaces in the name; that module would be
> somewhat hard to use from Python in normal ways.

Right; the file name will not contain spaces, but directory names could
without problems. Anyway, it is not advisable to use such a pattern.
Alternatives have been pointed out.

Reinhold

-- 
[Windows ist wie] die Bahn: Man muss sich um nichts kuemmern, zahlt fuer
jede Kleinigkeit einen Aufpreis, der Service ist mies, Fremde koennen
jederzeit einsteigen, es ist unflexibel und zu allen anderen Verkehrs-
mitteln inkompatibel.               -- Florian Diesch in dcoulm



More information about the Python-list mailing list