Trent Mick wrote:
>
> On Tue, Feb 06, 2001 at 12:01:51PM +0800, LUK ShunTim wrote:
> > Dear all,
> >
> > I'd like to put stuff under the site-packages directory but it appears
> > that site.py is not automatically imported at start up (both for the
> > python and pythonwin) , contrary to what is said in site.py.
> > Is this the case for activepython? Or do I have to load it manually?
>
> ActivePython *does* import site.py. You can watch it do so via the "-v"
> option to "python":
>
> H:\>python -v
> # D:\apps\Python20\lib\site.pyc matches D:\apps\Python20\lib\site.py
> import site # precompiled from D:\apps\Python20\lib\site.pyc
> # D:\apps\Python20\lib\os.pyc matches D:\apps\Python20\lib\os.py
> import os # precompiled from D:\apps\Python20\lib\os.pyc
> import nt # builtin
> # D:\apps\Python20\lib\ntpath.pyc matches D:\apps\Python20\lib\ntpath.py
> import ntpath # precompiled from D:\apps\Python20\lib\ntpath.pyc
> # D:\apps\Python20\lib\stat.pyc matches D:\apps\Python20\lib\stat.py
> import stat # precompiled from D:\apps\Python20\lib\stat.pyc
> # D:\apps\Python20\lib\UserDict.pyc matches D:\apps\Python20\lib\UserDict.py
> import UserDict # precompiled from D:\apps\Python20\lib\UserDict.pyc
> import win32api # dynamically loaded from D:\apps\Python20\win32\win32api.pyd
> ActivePython 2.0, build 202 (ActiveState Tool Corp.)
> based on Python 2.0 (#8, Oct 19 2000, 11:30:05) [MSC 32 bit (Intel)] on win32
> Type "copyright", "credits" or "license" for more information.
> >>>
>
> Note that the "-S" option can be used to tell python to skip site.py on
> startup.
>
Thanks very much. Here's something I don't understand.
This is what I got running
python
at the command prompt.
\begin{quote}
ActivePython 2.0, build 202 (ActiveState Tool Corp.)
based on Python 2.0 (#8, Oct 19 2000, 11:30:05) [MSC 32 bit (Intel)] on
win32
Type "copyright", "credits" or "license" for more information.
>>> dir()
['__builtins__', '__doc__', '__name__']
>>> dir(site)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: There is no variable named 'site'
>>> import site
>>> dir(site)
['_Printer', '__builtin__', '__builtins__', '__doc__', '__file__',
'__name__', '
_test', 'addpackage', 'addsitedir', 'encoding', 'here', 'makepath',
'os', 'prefi
x', 'prefixes', 'sitedir', 'sitedirs', 'sys']
>>>
\end{quote}
Why doesn't the first dir(site) list the names from the site module?
Regards,
ST
--
_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython