NewBie question: cannot import TKinter and os

Steve Holden sholden at holdenweb.com
Thu Dec 14 10:23:42 EST 2000


Bill Anderson <anderson at boi.hp.com> wrote in message
news:3A368893.FDC9CAC7 at boi.hp.com...
> Martin von Loewis wrote:
> >
> > etsang at my-deja.com writes:
> >
> > > 1. at the very first beginning, it says import site error. I know this
> > > module site is no longer required in Python 2.0 after dereading some
> > > doc in pytho.org. how can I make thie error go away??
> >
> > That is incorrect. Where did you read that? site.py is still needed.
>
> Perhaps from the site.py included in 2.0?
> """
> Append module search paths for third-party packages to sys.path.
>
> ****************************************************************
> * This module is automatically imported during initialization. *
> ****************************************************************
>
> In earlier versions of Python (up to 1.5a3), scripts or modules that
> needed to use site-specific modules would place ``import site''
> somewhere near the top of their code.  Because of the automatic
> import, this is no longer necessary (but code that does it still
>         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> works).
>
> """
> (emphasis mine)
>
> I, too am having problems importing site.py and os, at least Zope is
> anyway. I can do it just fine from the interpeter... it seems that not
> allcode that does it still works. :(
>
What that means is that, since Python 1.5 final, the site module is imported
without the programmer needing to explicitly request it.  The code is still
an important part of the startup sequence -- that's why the import was made
automatic!

Among other things, site.py looks for sitecustomize.py, and imports that if
it exists, allowing you to provide customization to your environment.

regards
 Steve







More information about the Python-list mailing list