how to get rid of pyc files ?

Gabriel Genellina gagsl-py2 at
Thu Jun 4 02:31:24 EDT 2009

[please keep the discussion on the list]

> may be python need a parameter to regenerate .pyo/pyc explicit ,not
> depending on magic number and  modification time.
> but i just wander if you simply just clear all .pyc than generate in
> one system manually, can than program run without error in another
> system?

Yes, you can always remove the .pyc files before starting, forcing a  
recompile. Also, see the compileall module.

Provided that both systems use the same Python version, you can precompile  
.pyc files on one and copy them to the other. Even more, some people  
deploy only .pyc files.

Gabriel Genellina

More information about the Python-list mailing list