.pyc files...

Eddie Parker eddie at kickingdragon.com
Sun Nov 14 09:24:08 CET 2004


I suppose that does work... Although I'm *extra* anal, and would love it to
be 'out-of-my-face' to begin with... :)

Something like (in my_python_file.py):

__PYC_DIRECTORY__ = './intermediate/'

Would be awesome. Although I'm uncertain of a few things:

a) Would such syntax be impossible, because of bootstrapping concerns?
(i.e., the .pyc file is already generated as it's being read? Or is it put
into memory, until it's finally byte compiled, so this might actually be
possible?)
b) Would this go against some sort of coding convention/design decision?
i.e., "Bylaw 3, subsection 42 of the Python 'Code' states: No config options
should be specified to the running interpreter, from within any .py file"?

Anyways, I think I'm more interested for education's sake - although it
*would* help me sleep at night, to send my .pyc files off into the nether..
(Heck - might be a good way to force no-gen of .pyc files, too:
__PYC_DIRECTORY__ = /dev/null)

Jus' a thought. :)

-e-

-----Original Message-----
From: python-list-bounces+eddie=kickingdragon.com at python.org
[mailto:python-list-bounces+eddie=kickingdragon.com at python.org] On Behalf Of
Stephen Waterbury
Sent: Sunday, November 14, 2004 1:06 AM
To: python-list at python.org
Subject: Re: .pyc files...

Eddie Parker 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 {} ';'"

Run after each test, or when feeling anal.  ;)

Steve
-- 
http://mail.python.org/mailman/listinfo/python-list


---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.788 / Virus Database: 533 - Release Date: 11/1/2004
 

---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.788 / Virus Database: 533 - Release Date: 11/1/2004
 




More information about the Python-list mailing list