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

Dick Moores rdm at rcblue.com
Tue Sep 4 10:50:45 CEST 2007


At 12:39 AM 9/3/2007, Alan Gauld wrote:
>"Dick Moores" <rdm at rcblue.com> wrote
>
> > Under Kent's tutelage, I've been experimenting with having no
> > PYTHONDOC,
>
>I assume you mean PYTHONPATH?

Yes. Careless of me.

> > 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,

I'm the only user.

>except you lose the flexibility of changing PYTHONPATH
>dynamically during a session using SET.

Could you show me how to use SET? And an example where it would be useful?

> > 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)
>
> >  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 couldn't find an IDLE list other than the one for IDLE developers 
(could I, as a lowly user, ask a question there?). But yours and 
Kent's hints and a lot of help from the developer of Ulipad (Ulipad 
was showing similar problems with what its shell showed for 
sys.path--lots if 2.4 stuff) led me to reinstalling 2.5.1 and 
uninstalling 2.4, plus doing some registry editing. I think I've 
finally succeeded. Here's what I have for my .pth file (I cut out 
some of what I had before, thanks to your comment):

E:\PythonWork\Functions\
E:\Python25\lib\site-packages\mine

And IDLE's shell now shows me this for sys.path:
IDLE 1.2.1
 >>> import functions
 >>> from sys import path
 >>> for x in path:
         print x


E:\Python25\Lib\idlelib
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\Functions
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
 >>>

And a similar good result with Ulipad.

> > I like the editing ease of having a .pth file rather than a
> > troublesome-to-edit 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.

Yes, I guess you're right. Still, with no clicks and a shortcut key I 
can get directly to pointer.pth in Textpad .




More information about the Tutor mailing list