A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-August/027595.html below:

[Python-Dev] _sre as part of python.dll

[Python-Dev] _sre as part of python.dll [Python-Dev] _sre as part of python.dllBarry A. Warsaw barry@zope.com
Fri, 9 Aug 2002 11:37:11 -0400
>>>>> "GvR" == Guido van Rossum <guido@python.org> writes:

    >> I remember doing some similar testing probably around the
    >> Python 2.0 timeframe and found a huge speed up by avoiding the
    >> import of site.py for largely the same reasons (avoiding tons
    >> of stat calls).  It's not always practical to avoid loading
    >> site.py, but if you can, you can get a big startup win.

    GvR> It's also easy: "python -S" avoids loading site.py.

Yes.  The one gotcha is that site-packages is put on sys.path via
site.py so using -S means you lose that directory.  You can, of
course, reinstall it explicitly by something like:

import sys
sitedir = os.path.join(sys.prefix, 'lib', 'python'+sys.version[:3],
                       'site-packages')
sys.path.append(sitedir)

-Barry



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4