.pyc files

Peter Hansen peter at engcorp.com
Tue Jan 28 15:00:58 CET 2003

Carl Banks wrote:
> Peter Hansen wrote:
> > Newt wrote:
> >>
> >> From a command line, how do I create pyc files? I know I can do it from
> >> within IDLE, but I want to use a different editor (for other languages).
> >
> > I just started wondering, why do you want to do this?  Do you
> > realize that Python automatically creates the pyc files for
> > you when you import modules?  It is only in rare cases that
> > you actually need to generate a .pyc file "manually".  Maybe
> > this is not such a case?  Just wondering...
> Maybe he's trying to install a package by hand.  If you just copy the
> .py files to a library directory, a user python process couldn't store
> the .pyc files, so you compile the .py files before copying.

I got the impression from the "I want to use a different editor" part
that he thinks he needs to compile Python code from within the editor
before running it during development, just as you often do in an IDE
for a statically compiled language such as C.  Maybe your theory is 
closer to the truth though.


More information about the Python-list mailing list