how to get rid of pyc files ?

JKPeck JKPeck at gmail.com
Sun May 24 18:51:55 EDT 2009


On May 24, 4:08 pm, Dave Angel <da... at ieee.org> wrote:
> pythoncuri... at gmail.com wrote:
> > On May 24, 3:58 pm, John Machin <sjmac... at lexicon.net> wrote:
>
> >> What problems? Like avoiding having to recompile your .py files makes
> >> your app run too fast?
>
> > There are real problems with this. I'm having similar problems when
> > switching
> > between Solaris and Windows.
> > The code is in clearcase, which uses some sort of network file
> > system.
> > In our case, that means that I'll be accessing the same directories
> > from both
> > platforms, so .pyc-files from one platform will be visible when I run
> > the
> > code on the other platform.
>
> > The .pyc-file will contain a string pointing to the file is was built
> > from.
> > The path to that file will be different under different platforms, so
> > when the
> > string is used, there will be error printouts.
> > At least I think that's the problem, the error printouts contains
> > paths that
> > are only valid on the other platform.
> > I don't have access to those computers atm, so I can't show the exact
> > message.
>
> > The only solution I've seen is to make sure to clean up the .pyc files
> > each
> > time I switch platform.
>
> Is Clearcase still around?  I hope it works better than it did in 1992.
>
> Somebody else has already pointed out that you can tell Python not to
> create those files (during your development stages).
>
> But if that won't work for some reason, perhaps you can do something
> with symbolic links.  I remember that RCS, for example, required that
> the archives be located in a directory immediately below the one with
> the sources.  So in order to share those archives, you made the
> subdirectory actually a link to a common network location.
>
> Your case would seem to be the opposite.  But I don't know enough about
> the current state of either Solaris or Clearcase to know the best answer.
>
> Perhaps Clearcase supports some form of "exclusion" parameter, wherein
> you say not to do version control on files with certain patterns, like .pyc

ClearCase gives you tremendous control over what can be seen at any
point.  Assuming that you are using dynamic views, the simplest way to
fix this is to use a different view for each platform.  They would
both be able to see the py files (although you could control that with
the configspec)as checked in, but the pyc files would not be checked
in and would automatically be view private.  So with two different
views, each platform would only see its own pyc files.

HTH,
Jon Peck



More information about the Python-list mailing list