[Python.NET] Re: application crash.

Stan Pinte stan at phidani.be
Wed Mar 30 18:52:24 CEST 2005

Stan Pinte a écrit :

>the following application (python/C#) is working properly, when I do not
>run simpy, a python framework. Once I enable, I get an immediate crash.

hello, I have skimmed the test case, and removed all dependancies toward
the Simpy framework.

Now it crashes once the python main loop is finished. If I comment out
the code used to pass a python function as a delegate to the C# frame,
it doesn't.

here is the code:

#test to show problem.

import sys,time
from CLR.System.Reflection import Assembly
a = Assembly.LoadWithPartialName("testpython")
from CLR.testpython import MainForm, TestDelegate

def test():
  return "hop"

if __name__ == '__main__':     
  form = MainForm.GetInstance()
  form.TestDelegateProperty = TestDelegate(test)
  print "done"


>See enclosed for runnable/compilable example. (run "python test.py"). To
>run, it needs the Simpy framework, GPL, that you can get there:
>Simpy makes heavy uses of the "yield" construct.
>as soon as I uncomment that line in the script:
>I get an immediate crash. I see no reason for this crash.
>I will open a tracker item.

More information about the PythonDotNet mailing list