[Tutor] What's up with Python 2.5.1's IDLE?

Alan Gauld alan.gauld at btinternet.com
Mon Sep 3 09:39:16 CEST 2007


"Dick Moores" <rdm at rcblue.com> wrote

> Under Kent's tutelage, I've been experimenting with having no
> PYTHONDOC,

I assume you mean PYTHONPATH?

> and instead putting a .pth file in
> E:\Python25\lib\site-packages\ I named pointers.pth.

I obviously failed to convince you of the superior flexibility
of using PYTHONPATH for your personal libs :-)
If your PC is only usd by you and you only have one
user account then that probably isn't a problem,
except you lose the flexibility of changing PYTHONPATH
dynamically during a session using SET.

> The contents of
> pointers.pth is:
> E:\Python25\
> E:\PythonWork\
> E:\PythonWork\Functions\
> E:\Python25\lib\site-packages\
> E:\Python25\lib\site-packages\mine

I would have expected Python to load the Python25 stuff itself.
You should only need the pointers file to contain the pointers
to the non standard directories (just as you would in PYTHONPATH)

> Here's what the Command Prompt shell shows for sys.path:

> E:\Python25\lib\site-packages\setuptools-0.6c5-py2.5.egg
> E:\Python25\lib\site-packages\dmath-0.9-py2.5.egg
> C:\WINDOWS\system32\python25.zip
> E:\Python25\DLLs
> E:\Python25\lib
> E:\Python25\lib\plat-win
> E:\Python25\lib\lib-tk
> E:\Python25
> E:\Python25\lib\site-packages
> E:\Python25\lib\site-packages\PIL
> E:\PythonWork
> E:\PythonWork\Functions
> E:\Python25\lib\site-packages
> E:\Python25\lib\site-packages\mine
> E:\Python25\lib\site-packages\win32
> E:\Python25\lib\site-packages\win32\lib
> E:\Python25\lib\site-packages\Pythonwin
> E:\Python25\lib\site-packages\wx-2.8-msw-unicode
> >>>
> All good.

Not quite all good - you have multiple entries
for site-packages...

> However, this is what IDLE's shell shows for sys.path:
>
> E:\Python25\Lib\idlelib
> E:\Python24\lib\site-packages\setuptools-0.6c5-py2.4.egg
> C:\WINDOWS\system32\python24.zip
> E:\Python25\Lib\idlelib
> E:\Python24\DLLs
> E:\Python24\lib
> E:\Python24\lib\plat-win
> E:\Python24\lib\lib-tk
> E:\Python24
> E:\Python24\lib\site-packages
> E:\Python24\lib\site-packages\wx-2.6-msw-ansi
>
> I do still have Python 2.4, but why does Python 2.5.1's IDLE's shell
> show all those things from 2.4, and only shows the path to itself in 
> 2.5.1?

It looks like IDLE has its own mechanism for populating sys.path
and it may be reading something in the Registry. This might be
a question to ask on the IDLE mailing list?

> I like the editing ease of having a .pth file rather than a
> troublesome-to-edit PYTHONDOC, but I need to first clear up the
> problem with IDLE (which works fine with a PYTHONDOC).

I'm not sure I understand what you mean by the editing ease?
You can change PYTHONPATH with a simple SET command
(albeit temporarily) and 3 mouse clicks takes you to the dialog
editor.

HTH,

Alan G 




More information about the Tutor mailing list