Hello:
I am not sure if this is a bug, or just me attempting to run code on a
platform it was not designed for but ...
Here is the traceback I get when I attempt to display the 'helloform.py' using
the python version shipped with the .tar.gz
__________________________________________________________
C:\Desktop\PythonNet-1.0-beta2>python.exe .\demo\helloform.py
Unhandled Exception: System.ArgumentException: The parameter is incorrect.
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32
errorCode
, IntPtr errorInfo)
at System.Runtime.InteropServices.Marshal.FreeHGlobal(IntPtr hglobal)
at Python.Runtime.StaticMethodWrapper..ctor(Type obType, String name)
at Python.Runtime.ImportHook.Initialize()
at Python.Runtime.Runtime.Initialize()
at Python.Runtime.PythonEngine.Initialize()
at PythonConsole.Main(String[] args)
C:\Desktop\PythonNet-1.0-beta2>
___________________________________________________________
I get the same traceback with PythonNet-1.0-beta1 , however, both
PythonNet-preview1 and PythonNet-preview2 continue to work fine ( at least
for the limited testing performed).
I am running Windows 98 (fully updated from Microsoft) using Win4Lin on top of
i386 linux , kernel 2.2.18. I have only one version of python on the
'virtual' machine (2.3.2) -- installed using the standard python.org.
installer.
The .NET Framework version is 1.1.4322
Any thoughts or suggestions?
Sincerely,
J
> I just run it in a fresh Win2k3 install and it crashes. I tried running
> python.exe demo/helloform.py first and it crashed then just decided to try
> python.exe alone and that's a problem. Any idea what's up?
mmm... I just tried on a w2k3 box, and what I got was:
- startup from cygwin shell works ok
- startup from cmd shell works ok
- double-click on python.exe - crashes :(
It doesn't do this on XP. I'll have to dig into this one.
> Will this let me develop .net web applications in Python as I would in C#?
>
> I understand you are embedding Python, similar to me embedding Python for
> use in Delphi applications. Would this work for web development or would I
> have all sorts of wrappers for my Python code in a first class
> language like
> C# which might just be calling to execute the Python code?
It doesn't allow you define types that are directly visible at compile-time
to C#, etc., so you probably would have to implement some sort of "pass-
through" to delegate to your Python code. It should be possible to come
up with a generic dispatcher though, so you wouldn't necessarily have
to write a lot of wrappers.
Brian Lloyd brian(a)zope.com
V.P. Engineering 540.361.1716
Zope Corporation http://www.zope.com
Hi all -
For the intrepid, I've checked in a number of fixes to things
that have come up on the list:
- Events refactored, -= now works for internalcalls, events
are no longer directly callable (use OnSomeEvent(...) instead)
- Implicit assembly loading now uses the PYTHONPATH to find
assemblies. This means you can just add to sys.path to use an
assembly that doesn't live in appbase or the GAC
- Fixed a dumb bug in constructor handling that could cause you
to get an 'IntPtr.Zero' instance rather than an exception in
some cases when instantiating an object (this was the root of
Michael's Point subclassing problem)
If any of these are holding you up, you can get the fixes from CVS.
I'm going to try to make a b2 tonight if the baby holds off for one
more day :)
Brian Lloyd brian(a)zope.com
V.P. Engineering 540.361.1716
Zope Corporation http://www.zope.com
Python for .NET 1.0 beta 2 has been released - you can download
it from:
http://www.zope.org/Members/Brian/PythonNet/
Python for .NET is a near-seamless integration of Python with the
.NET common language runtime. For more details, see the README:
http://www.zope.org/Members/Brian/PythonNet/README.html
The beta 2 release fixes several issues found in beta 1:
- It is now possible to import assemblies from any directory
on the PYTHONPATH (sys.path), in addition to importing from
the appbase and the GAC
- A problem that prevented registration of event handlers from
working for some kinds of objects has been fixed
- Constructor invokation handled some error conditions incorrectly,
leading to odd results when calling some constructors
There is also now a mailing list for discussion, questions and
issues related to Python for .NET at: pythondotnet(a)python.org.
To subscribe to the mailing list or read the online archives, see:
http://mail.python.org/mailman/listinfo/pythondotnet
Brian Lloyd brian(a)zope.com
V.P. Engineering 540.361.1716
Zope Corporation http://www.zope.com
Full pkg crashes when starting the interpreter and existing 2.3.2 distro
when importing anything from CLR.
"Application generated an exception that could not be handled".
Regards,
Petri
First and foremost I want to thank Bryan Lloyd for his great
effort of making something useful for Python guys on the .NET Framework.
Now I gotta explain the subject. I think that the "dream" feature for a
Python .NET implementation is generation of standard IL code (not only
bridging). I mean something like the previous [1] effort made by Mark
Hammond with his Python .NET implementation (I've talked to him by email
months ago and he told me that he stopped working on it cause he was no
longer an ActiveState employee and nobody financed him to continue working).
Do you, Brian, ever thougth to do something like that? What do you
think about that?
Thanks in advance
1 - http://starship.python.net/crew/mhammond/dotnet/
--
Lawrence "Rhymes" Oluyede
http://loluyede.blogspot.com
Hi all -
Looking at fixing a problem with events, I'm realizing that
my original plan has a big hole in it :(
Here's the situation: the framework requires that an event be
implemented by providing an add_SomeEvent and a remove_SomeEvent
method.
However, the actual storage and mechanisms used to call the
delegates registered via those special methods are completely
up to the implementor of a class.
When you write, for example, a class with an event in C# using
the MS tools, you get:
- add_* and remove_* methods
- a private internal field to hold the delegate
You do *not* get an automagic method to fire the event, because
the class implementor is supposed to provide this if it appropriate
(but may choose not to).
The current Python.NET event stuff expects this setup, and it
allows you to treat the event as a callable object - when you
call the event, it tries to call that internal delegate.
The problem is that its wrong :) According to everything I can
find, a class is supposed to provide an 'OnSomeEvent' method to
fire an event if it is appropriate for client code to fire the
events of the class explicitly. If a class does not provide an
'OnSomeEvent' method, then it is assumed that it is not
appropriate for the event to be fired by a client (and there is
in fact no reliable way for the client to even try, since the
dispatching to subscribers is purely internal to the class and
could be done in arbitrary ways).
I'm tempted to remove the ability to call event objects directly
from Python, as this would match the convention and what you'd
have to do in C# or VB, etc. (you'd call the OnSomeEvent method
instead).
The alternative would have to be doing some kind of automagical
thing where we'd try lookup up an OnXXX if the usual private
event field wasn't there, but that seems nasty...
thoughts?
Brian Lloyd brian(a)zope.com
V.P. Engineering 540.361.1716
Zope Corporation http://www.zope.com
Hi
I changed the calls to Assembly.LoadFile() to Assembly.LoadFrom() and the
problem appears to be resolved. I'm a newcomer to .NET so I'm not sure
whether the behaviour when Assembly.LoadFile() was used to load the
Assemblies is correct or not...
Regards
Gordon
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.536 / Virus Database: 331 - Release Date: 03/11/2003
For those who may be interested,
I subscribed this list to gmane.org as
gmane.comp.python.dotnet
IOW you can also read it with your newsgroup client.
--
Godefroid Chapelle (aka __gotcha) http://bubblenet.be
Hi
If I create a new (Form) class using Visual Studio and then subclass it in
Python then I get "TypeError: no method matches given arguments" when
executing
'WinForms.Application.Run(self)'.
The new Form instance is created OK and the following returns true:
'isinstance(form, System.Windows.Forms.Form)'
The only differences from the working examples appear to be:
1. The parameter is an object subclassed from a class that is in turn
subclassed from System.Windows.Forms.Form. (The intermediate class is
written in C#).
2. The class I created is not in the GAC. It is loaded using
'Assembly.LoadFile("D:\\forecastdev\\net\\TestGraphs\\bin\\Debug\\TestGraphs
.exe")'
Has anybody any suggestions?
Regards
Gordon
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.532 / Virus Database: 326 - Release Date: 27/10/2003