How to modify module search path?

hwan
2007-07-04
2013-05-30
  • hwan
    hwan
    2007-07-04

    Hello all,

    I'm wondering how I can configure PythonCE to get different module search path which is set by PYTHON_PATH environment variable on PC.
    If you'd add any comment please email it for me at "shh at modmen.com" as well.

    Thanks,
    Hwan

     
    • Hi Hwan,
      because there's no environment variable on WinCe, afaik the only way to add a directory in the sys.path on startup is to create a .pth file in
      <PythonCE Path>/Lib/site-packages/.
      Each line of the .pth file should point to a relative or absolute package directory.
      You can get more detailed information by reading site.py (you can find it on a desktop version or in the python2X.zip)
      You can of course programatically manipulate sys.path as a regular python list object.

      Alexandre.