Saving disk space (was: Re: Python versions (was Re: os.execl()))

Sheila King sheila at spamcop.net
Mon Aug 27 16:03:45 EDT 2001


On Mon, 27 Aug 2001 13:29:38 -0500, Skip Montanaro <skip at pobox.com>
wrote in comp.lang.python in article
<mailman.998937042.23650.python-list at python.org>:

:    Sheila> I had suggested that he provide a more recent version in a
:    Sheila> separate directory, but in the end, I got to install the
:    Sheila> upgraded Python in my own server space. (And it takes no small
:    Sheila> chunk of space, for those of us on small, basic web hosting
:    Sheila> packages.)
:
:You can trim back some of the space from a standard install by deleting all
:the .pyc or .pyo files.  If you never use "python -O" or "python -OO", the
:.pyo files will never be used.  On my sytem the .pyo's take up 7MB and the
:.pyc's almost 9MB (just how much you save will depend on what you have
:installed in the site-packages directory).  If write access to your
:python2.1 directory tree is possible by those scripts needing .py[co] files,
:you can just scrap all of them and let those scripts compile only what they
:need.

Thanks. I just deleted the .pyo files, and that reclaimed a little over
3 meg. I'm not really hurting for space at the moment, so I'll leave the
.pyc files there.

(I had already deleted all the .py[oc] files under lib-old. I'm a bit
too cautious to delete the .py files in there.)

:You can trim another 4MB by deleting the test/ directory and another 100K or
:so by deleting lib-old (just make sure you don't actually use any of those
:modules in your scripts).

The test/ directory is long since gone, as the total space my site had
at the time of last install, was 45 MB. Now I have 70 MB, with near to
half of that free. But clearly, no room for the unnecessary stuff. When
I do an install, I have to temporarily go over my quota. I haven't
called it to the sysadmin's attention, and he hasn't said anything.
After the install is complete, I start deleting stuff like crazy.

--
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org/





More information about the Python-list mailing list