What does `import _preamble` do in Python?

3.5k Views Asked by At

I notice the following at the top of Twisted's twistd.py script:

import os, sys

try:
    import _preamble
except ImportError:
    sys.exc_clear()

sys.path.insert(0, os.path.abspath(os.getcwd()))

What does import _preamble do? I can't seem to find any references to it on the google-mage.

1

There are 1 best solutions below

1
On BEST ANSWER

_preamble is a module like any other. In twisted's case, this is simply the module that sets up sys.path so that you can run twisted in development setups.