[Tutor] when is "pythondontwritebytecode" useful?

Albert-Jan Roskam fomcl at yahoo.com
Mon Jan 20 11:42:57 CET 2014


Hi,


When is setting a PYTHONDONTWRITEBYTECODE environment variable useful? Or set sys.dont_write_bytecode to True? Or start Python with the -B option?
I know what it does (http://docs.python.org/2/using/cmdline.html#envvar-PYTHONDONTWRITEBYTECODE), i.e. no pyc or pyo fiules are written, but WHY is that sometimes a good thing? The only useful scenario I can think of is when you don't have write rights to create pyc files but you want to use a package anyway.


Perhaps related: it is possible to import zip files, but no pyc files will be created when you do this. However, I recently opened an EGG file with a zip utility (because I knew egg uses zipimport so it's a zip-like format) and I noticed that there were .pyc files. If the creator of the egg put them there, they'd only be useful if the user uses the exact same Python implementatiopn and version, right? So hoiw can the be there?

 
Regards,

Albert-Jan




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a 

fresh water system, and public health, what have the Romans ever done for us?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140120/b1acd81d/attachment-0001.html>


More information about the Tutor mailing list