PEP 304 - is anyone really interested?
Thomas Guettler
guettli at thomas-guettler.de
Thu Jun 23 10:32:22 EDT 2005
Am Wed, 22 Jun 2005 18:01:51 -0500 schrieb Skip Montanaro:
>
> I wrote PEP 304, "Controlling Generation of Bytecode Files":
>
> http://www.python.org/peps/pep-0304.html
>
...
Hi,
I am interested in a small subset: I want to import a file without
a '.pyc' being generated.
Background: I sometimes missuse python for config files. For example
there is a file $MYAPP/etc/debuglog.py. This file contains simple
assignments
search=0
indexing=1
....
In the code I use it like this:
sys.path.append(...) # Put $MYAPP/etc into the path
import debuglog
...
if debuglog.search:
print "Searching for ...."
I don't want pyc files in the etc directory.
Up to now I do it like this:
import debuglog
try:
os.unlink("...debuglog.pyc")
except:
pass
Thomas
--
Thomas Güttler, http://www.thomas-guettler.de/
More information about the Python-list
mailing list