Python for .NET 1.0 beta 1 released

Paul Moore pf_moore at yahoo.co.uk
Tue Oct 28 17:50:09 EST 2003


"Brian Lloyd" <brian at zope.com> writes:

> Python for .NET 1.0 beta 1 has been released - you can download 
> it from: 
>
>   http://www.zope.org/Members/Brian/PythonNet/

A quote from the README:

  **Can I use it with my existing Python installation?**

    Yes, at least on win32 systems. Just copy the files Python.Runtime.dll 
    and CLR.dll from the PythonNet directory to the root directory of your
    python installation.

Actually, this isn't entirely true: I copied the 2 files as described,
and then tried the following:

>python
Python 2.3.2 (#49, Oct  2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import CLR.System.Windows.Forms
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: No module named System.Windows.Forms
>>> import CLR
>>> import CLR.System.Windows.Forms

It looks like CLR needs to be imported explicitly, before anything
else. This is *not* the case with the python.exe which is supplied
- actually, it is, it's just that CLR gets implicitly imported
somewhere in the startup:

C:\Data\PythonNet-1.0-beta1
>python
Python 2.3.2 (#49, Oct  2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.modules.keys()
['copy_reg', 'locale', '__main__', 'site', '__builtin__', 'encodings',
'os.path' , 'encodings.encodings', 'encodings.codecs', 'ntpath',
'UserDict', 'encodings.ex ceptions', 'nt', 'stat', 'zipimport',
'warnings', 'encodings.types', '_codecs', 'encodings.cp1252', 'sys',
'codecs', 'types', '_locale', 'CLR', 'signal', 'linec ache',
'exceptions', 'os']

Note here ---------------------^^^

Paul.
-- 
This signature intentionally left blank




More information about the Python-list mailing list