The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by dogberry]

OK, I give up ... where is the startup/config file in the Python 2.2 Windows
distribution, that sets up the sys.path.

I am tired of having to use sys.path.append(...) every time I start IDLE

Isn't there a file I can edit to do this automatically every time IDLE starts.

I even tried setting the PYTHONPATH variable in the Win2k "Settings->System"
panel but this did not work.

Any help greatly appreciated.

Gordon
import-bot (20211) [Avatar] Offline
#2
Re: sys.path
[Originally posted by d. harms]

Setting the PYTHONPATH variable should have worked (that is after the next
reboot of your system).

I prefer to use a ".pth" file. Place the directories you want to always be
added to sys.path in a file called (for example) "myModules.pth" and place
this file in the Csmilieython22" directory on Windows (see the top of page 112 of
the book for an example).

> OK, I give up ... where is the startup/config file in the Python 2.2 Windows
> distribution, that sets up the sys.path.
>
> I am tired of having to use sys.path.append(...) every time I start IDLE
>
> Isn't there a file I can edit to do this automatically every time IDLE starts.
>
> I even tried setting the PYTHONPATH variable in the Win2k "Settings->System"
> panel but this did not work.
>
> Any help greatly appreciated.
>
> Gordon
import-bot (20211) [Avatar] Offline
#3
Re: sys.path
[Originally posted by carloschoy]

Problem I found with setting Pythonpath in Win32 environment is that PY2EXE
stopped working. Instead of sys.path, I have all my path declarations set
using the SET PATH environment variable.

Frankly I've never used sys.path, and with just using SET PATH have never had
a problem importing modules. Perhaps someone can tell me what benefit there
is to using sys.path that SET PATH does not offer?