newbie - How do I import automatically?

Mike Meyer mwm at mired.org
Tue Nov 15 17:07:01 EST 2005


bobueland at yahoo.com writes:
> I've tried as you said but it doesn't work. I'm working with Windows
> XP. I right click at my computer go to Advanced, choose Environment
> Variables and set PYTHONSTARTUP variable to C:\Python24\binit.py. It
> looks like this
>
> # binit.py
> from btools import *
>
> I've restarted the computer and started IDLE but I only get
>
> IDLE 1.1.1
>>>> dir()
> ['__builtins__', '__doc__', '__name__']
>>>> 
>
> What could be wrong?

The problem is idle. PYTHONSTARTUP only works for interactive Python
session, and apparently idle doesn't honor it. You'll have to get
someone who uses idle to explain how to get that functionality.

        <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list