From dirk.krause at pixelpark.com Wed Oct 1 06:49:13 2008 From: dirk.krause at pixelpark.com (Dirk Krause) Date: Wed, 1 Oct 2008 06:49:13 +0200 Subject: [Python.NET] error messages References: <475454.68582.qm@web34802.mail.mud.yahoo.com> <72C1C9E5780A134F896530D480F22BB70214279F@hermes.bitlab.de> <48E2E9C1.9010502@sil.org> Message-ID: <72C1C9E5780A134F896530D480F22BB7021427A1@hermes.bitlab.de> OK, it works now, thanks to both of you for the trick! (it's u'2.0.50727.1434' here) I applied that patch that was mentioned in Feihong's blog post from the mailing list and built that thing and it works - all three demos running now, and Feihongs test, too. Just to reiiterate the posting that made the difference: http://mail.python.org/pipermail/pythondotnet/2008-January/000771.html Index: pythonnet/src/runtime/assemblymanager.cs =================================================================== --- pythonnet/src/runtime/assemblymanager.cs (r?vision 90) +++ pythonnet/src/runtime/assemblymanager.cs (copie de travail) @@ -87,7 +87,12 @@ static void AssemblyLoadHandler(Object ob, AssemblyLoadEventArgs args){ Assembly assembly = args.LoadedAssembly; assemblies.Add(assembly); - ScanAssembly(assembly); + // .NET v2.0 SP1 bug workaround ; ScanAssembly called on newly created DynamicAssembly causes problems + // only scan non-dynamic assemblies... + if ( !(assembly is System.Reflection.Emit.AssemblyBuilder) ) + { + ScanAssembly(assembly); + } } ________________________________ Von: Craig Farrow [mailto:craig_farrow at sil.org] Gesendet: Mi 01.10.2008 05:08 An: Dirk Krause Cc: Feihong Hsu Betreff: Re: AW: AW: [Python.NET] error messages Dirk, Disabling that button.Click line makes helloform.py work for me, too. It looks like the Great Firewall is blocking googlepages.com, so unfortunately I can't try that fix -- but that sounds like the right direction. Here's how to get the version of .NET being used: >>> from System import Environment >>> Environment.Version.ToString() u'2.0.50727.1433' >>> Craig. 10/1/2008 2:57 AM d?, Dirk Krause pisdimis: hmmm ... I have SP1 for sure, but also .NET 3.5 - maybe that is the problem? ________________________________ Von: Feihong Hsu [mailto:hsu.feihong at yahoo.com] Gesendet: Di 30.09.2008 20:44 An: Craig Farrow; Dirk Krause Cc: pythondotnet at python.org Betreff: Re: AW: [Python.NET] error messages Usually you can find a clue by looking in Control Panel > Add/Remove Programs. If you got SP1 or something like that, it'll be listed. --- On Tue, 9/30/08, Dirk Krause wrote: From: Dirk Krause Subject: AW: [Python.NET] error messages To: "Feihong Hsu" , "Craig Farrow" Cc: pythondotnet at python.org Date: Tuesday, September 30, 2008, 12:35 PM nah, doesnt work here: D:\projects\pyov>helloform.py Unbehandelte Ausnahme: System.IO.FileLoadException: Die Datei oder Assembly Python.Runtime, Version=2.0.0.2, Culture=neu tral, PublicKeyToken=64e14e845abf2e60 oder eine Abh?ngigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinitio n der Assembly stimmt nicht mit dem Assemblyverweis ?berein. (Ausnahme von HRESULT: 0x80131040) Dateiname: Python.Runtime, Version=2.0.0.2, Culture=neutral, PublicKeyToken=64e14e845abf2e60 bei Python.Runtime.PythonConsole.Main(String[] args) I probably have to compile it. Is there a way to find out which .NET version is installed? ________________________________ Von: Feihong Hsu [mailto:hsu.feihong at yahoo.com] Gesendet: Di 30.09.2008 18:56 An: Craig Farrow; Dirk Krause Cc: pythondotnet at python.org Betreff: Re: [Python.NET] error messages This problem sounds familiar. Perhaps you guys are using .NET 2.0 with SP1 applied? Then this blog post of mine might help: http://feihonghsu.blogspot.com/2008/02/pythonnet-20-for-net-sp1_15.html If you want, you can try the binary that I made instead of applying the patch yourself. --- On Tue, 9/30/08, Dirk Krause wrote: From: Dirk Krause Subject: Re: [Python.NET] error messages To: "Craig Farrow" Cc: pythondotnet at python.org Date: Tuesday, September 30, 2008, 8:50 AM right you are again. splitter works here, too. Can you confirm that helloform runs when you disable line 33? # Register the event handler # self.button.Click += self.button_Click ________________________________ Von: Craig Farrow [mailto:craig_farrow at sil.org] Gesendet: Di 30.09.2008 15:25 An: Dirk Krause Cc: pythondotnet at python.org Betreff: Re: AW: [Python.NET] error messages Ah, yes. On my system (Vista, Python 2.4 or 2.5, pythonnet-2.0-alpha2) only splitter.py works out of the three demos. I haven't tried to figure out why... Craig. 9/30/2008 9:13 PM d?, Dirk Krause pisdimis: much better! ...python itself runs now. but not really good either, trying to run helloform.py gives me: D:\projects\pyov>helloform.py Unbehandelte Ausnahme: System.TypeInitializationException: Der Typeninitialisierer f?r Python.Runtime.CodeGenerator hat eine Ausnahme verursacht. ---> System.InvalidCastException: Das Objekt des Typs System.Reflection.Module kann nicht in T yp System.Reflection.Emit.ModuleBuilder umgewandelt werden. bei System.Reflection.Emit.AssemblyBuilderData.GetInMemoryAssemblyModule() bei System.AppDomain.InternalDefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access, String dir, Evide nce evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, St ackCrawlMark& stackMark, IEnumerable`1 unsafeAssemblyAttributes) bei System.AppDomain.DefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access) bei Python.Runtime.CodeGenerator..cctor() --- Ende der internen Ausnahmestapel?berwachung --- bei Python.Runtime.DelegateManager.GetDispatcher(Type dtype) bei Python.Runtime.DelegateManager.GetDelegate(Type dtype, IntPtr callable) bei Python.Runtime.EventObject.AddEventHandler(IntPtr target, IntPtr handler) bei Python.Runtime.EventBinding.nb_inplace_add(IntPtr ob, IntPtr arg) bei Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw) bei Python.Runtime.MetaType.tp_call(IntPtr tp, IntPtr args, IntPtr kw) bei Python.Runtime.Runtime.Py_Main(Int32 argc, String[] argv) bei Python.Runtime.PythonConsole.Main(String[] args) ________________________________ Von: Craig Farrow [mailto:craig_farrow at sil.org] Gesendet: Di 30.09.2008 14:53 An: Dirk Krause Cc: pythondotnet at python.org Betreff: Re: [Python.NET] error messages Try the UCS2 directory. Craig. 9/30/2008 5:54 PM d?, Dirk Krause pisdimis: Hi, I get the following error message when trying to run the python.exe from python2.5-UCS4 (I have a fully installed Python 2.5), any ideas? Vista professional here. ... unfortunately in german: """ Unbehandelte Ausnahme: System.IO.FileLoadException: Die Datei oder Assembly Python.Runtime, Version=0.0.0.0, Culture=neu tral, PublicKeyToken=null oder eine Abh?ngigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assemb ly stimmt nicht mit dem Assemblyverweis ?berein. (Ausnahme von HRESULT: 0x80131040) Dateiname: Python.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null bei Python.Runtime.Runtime.PyUnicode_FromUnicode(String s, Int32 size) bei Python.Runtime.Runtime.Initialize() bei Python.Runtime.PythonEngine.Initialize() bei Python.Runtime.PythonConsole.Main(String[] args) """ Thanks, Dirk ________________________________ _________________________________________________ Python.NET mailing list - PythonDotNet at python.org http://mail.python.org/mailman/listinfo/pythondotnet _________________________________________________ Python.NET mailing list - PythonDotNet at python.org http://mail.python.org/mailman/listinfo/pythondotnet -------------- next part -------------- An HTML attachment was scrubbed... URL: From dthomsonit at googlemail.com Thu Oct 2 17:38:10 2008 From: dthomsonit at googlemail.com (David Thomson) Date: Thu, 2 Oct 2008 16:38:10 +0100 Subject: [Python.NET] Can you unsubscribe me please Message-ID: <331b591c0810020838o1aa4015byaf3d1d9443ee906d@mail.gmail.com> From sambasivareddy.s at patni.com Fri Oct 10 16:03:13 2008 From: sambasivareddy.s at patni.com (sambasivareddy) Date: Fri, 10 Oct 2008 19:33:13 +0530 Subject: [Python.NET] can i use LabVIEW VI in Python Script? Message-ID: <000601c92ae0$efa66470$750ba8c0@patni.com> Hi all, I have a doubt in Python.Net. if any one knows plz give reponse for this. * Can i use LabVIEW VI in Python Script? Thanks and Regards, Sambasivareddy.S http://www.patni.com World-Wide Partnerships. World-Class Solutions. _____________________________________________________________________ This e-mail message may contain proprietary, confidential or legally privileged information for the sole use of the person or entity to whom this message was originally addressed. Any review, e-transmission dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this e-mail in error kindly delete this e-mail from your records. If it appears that this mail has been forwarded to you without proper authority, please notify us immediately at netadmin at patni.com and delete this mail. _____________________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffames at gmail.com Thu Oct 16 01:23:05 2008 From: jeffames at gmail.com (Jeff Ames) Date: Thu, 16 Oct 2008 08:23:05 +0900 Subject: [Python.NET] struct with no explicit constructor Message-ID: Hello, I'm trying to create an instance of a struct that has no explicit constructor in C#, but in python I always get a TypeError. My test struct in C#: namespace Foo { public struct MyStruct { public int x; } } In python: mystruct = Foo.MyStruct() This gives me "TypeError: no constructor matches given arguments". I get slightly further calling __new__ explicitly: mystruct = object.__new__(Foo.MyStruct) mystruct.__init__() However, then I get an exception from when mystruct goes out of scope: Unhandled Exception: System.ArgumentException: GCHandle value cannot be zero at System.Runtime.InteropServices.GCHandle.op_Explicit (IntPtr value) [0x00000] at Python.Runtime.ManagedType.GetManagedObject (IntPtr ob) [0x00000] at Python.Runtime.ClassBase.tp_dealloc (IntPtr ob) [0x00000] at (wrapper native-to-managed) Python.Runtime.ClassBase:tp_dealloc (intptr) at (wrapper managed-to-native) Python.Runtime.Runtime:Py_Main (int,string[]) at Python.Runtime.PythonConsole.Main (System.String[] args) [0x00000] If I add an explicit constructor to MyStruct, everything works fine, but this is a third-party library that I'd like to use as-is if possible. Is there any way to do this? Thanks, Jeff From matthew.zaleski at spamcop.net Thu Oct 16 01:27:24 2008 From: matthew.zaleski at spamcop.net (Matthew Zaleski) Date: Wed, 15 Oct 2008 19:27:24 -0400 Subject: [Python.NET] can i use LabVIEW VI in Python Script? In-Reply-To: <000601c92ae0$efa66470$750ba8c0@patni.com> References: <000601c92ae0$efa66470$750ba8c0@patni.com> Message-ID: <20081015192724.evxurxdr0gkkgggc-znggurj.mnyrfxv@webmail.spamcop.net> I have not done this but a quick Google gave this: http://mail.python.org/pipermail/python-win32/2006-July/004788.html Looking at the replies, folks are connecting via CPython on the .NET interface. In theory you can also access it via Python.NET. Can I say for sure? No. I'm still a lurker on this list and haven't had time to play with Python.NET. I have done COM and .NET from CPython without too much trouble (it all depends on how much interface the application exposed). On Fri, 10 Oct 2008 19:33:13 +0530, sambasivareddy wrote: > Hi all, > > I have a doubt in Python.Net. if any one knows plz give reponse for this. > > > > * Can i use LabVIEW VI in Python Script? > > > > > > Thanks and Regards, > > Sambasivareddy.S > > > http://www.patni.com > World-Wide Partnerships. World-Class Solutions. > _____________________________________________________________________ > > This e-mail message may contain proprietary, confidential or legally > privileged information for the sole use of the person or entity to > whom this message was originally addressed. Any review, > e-transmission dissemination or other use of or taking of any action > in reliance upon this information by persons or entities other than > the intended recipient is prohibited. If you have received this > e-mail in error kindly delete this e-mail from your records. If it > appears that this mail has been forwarded to you without proper > authority, please notify us immediately at netadmin at patni.com and > delete this mail. > _____________________________________________________________________ > From sandrohardy at web.de Wed Oct 22 22:25:35 2008 From: sandrohardy at web.de (Sandro Hardy) Date: Wed, 22 Oct 2008 22:25:35 +0200 Subject: [Python.NET] System.TypeInitializationException Message-ID: <48FF8C3F.6040108@web.de> Hi, this Code: --------------------------------------------------------- def stateChanged(): print "sdf" bb.WiimoteChanged += System.EventHandler(stateChanged); --------------------------------------------------------- ist working in a cygwin xterm. (no python installed in cygwin) But ist gives me this error in a Windows shell: Unhandled Exception: System.TypeInitializationException: The type initializer fo r 'Python.Runtime.CodeGenerator' threw an exception. ---> System.InvalidCastExce ption: Unable to cast object of type 'System.Reflection.Module' to type 'System. Reflection.Emit.ModuleBuilder'. at System.Reflection.Emit.AssemblyBuilderData.GetInMemoryAssemblyModule() at System.AppDomain.InternalDefineDynamicAssembly(AssemblyName name, Assembly BuilderAccess access, String dir, Evidence evidence, PermissionSet requiredPermi ssions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, Sta ckCrawlMark& stackMark, IEnumerable`1 unsafeAssemblyAttributes) at System.AppDomain.DefineDynamicAssembly(AssemblyName name, AssemblyBuilderA ccess access) at Python.Runtime.CodeGenerator..cctor() --- End of inner exception stack trace --- at Python.Runtime.DelegateManager.GetDispatcher(Type dtype) at Python.Runtime.DelegateManager.GetDelegate(Type dtype, IntPtr callable) at Python.Runtime.DelegateObject.tp_new(IntPtr tp, IntPtr args, IntPtr kw) at e__NativeCall.Call_3(IntPtr , IntPtr , IntPtr , IntPtr ) at Python.Runtime.MetaType.tp_call(IntPtr tp, IntPtr args, IntPtr kw) at Python.Runtime.Runtime.Py_Main(Int32 argc, String[] argv) at Python.Runtime.PythonConsole.Main(String[] args) Any hints? Regards, Sandro From sandrohardy at web.de Thu Oct 23 20:20:27 2008 From: sandrohardy at web.de (Sandro Hardy) Date: Thu, 23 Oct 2008 20:20:27 +0200 Subject: [Python.NET] System.TypeInitializationException In-Reply-To: <48FF8C3F.6040108@web.de> References: <48FF8C3F.6040108@web.de> Message-ID: <4900C06B.4030806@web.de> Hi, the problem has flown away today. Maybe because of installing pygame today morning(it is the only thing i changed), but I don't think so. Probably it is typical Windows behaviour. Regards, Sandro Sandro Hardy schrieb: > Hi, > > this Code: > --------------------------------------------------------- > def stateChanged(): > print "sdf" > > bb.WiimoteChanged += System.EventHandler(stateChanged); > --------------------------------------------------------- > > ist working in a cygwin xterm. (no python installed in cygwin) > > > But ist gives me this error in a Windows shell: > > Unhandled Exception: System.TypeInitializationException: The type > initializer fo > r 'Python.Runtime.CodeGenerator' threw an exception. ---> > System.InvalidCastExce > ption: Unable to cast object of type 'System.Reflection.Module' to type > 'System. > Reflection.Emit.ModuleBuilder'. > at > System.Reflection.Emit.AssemblyBuilderData.GetInMemoryAssemblyModule() > at System.AppDomain.InternalDefineDynamicAssembly(AssemblyName name, > Assembly > BuilderAccess access, String dir, Evidence evidence, PermissionSet > requiredPermi > ssions, PermissionSet optionalPermissions, PermissionSet > refusedPermissions, Sta > ckCrawlMark& stackMark, IEnumerable`1 unsafeAssemblyAttributes) > at System.AppDomain.DefineDynamicAssembly(AssemblyName name, > AssemblyBuilderA > ccess access) > at Python.Runtime.CodeGenerator..cctor() > --- End of inner exception stack trace --- > at Python.Runtime.DelegateManager.GetDispatcher(Type dtype) > at Python.Runtime.DelegateManager.GetDelegate(Type dtype, IntPtr > callable) > at Python.Runtime.DelegateObject.tp_new(IntPtr tp, IntPtr args, > IntPtr kw) > at e__NativeCall.Call_3(IntPtr , IntPtr , IntPtr , IntPtr ) > at Python.Runtime.MetaType.tp_call(IntPtr tp, IntPtr args, IntPtr kw) > at Python.Runtime.Runtime.Py_Main(Int32 argc, String[] argv) > at Python.Runtime.PythonConsole.Main(String[] args) > > Any hints? > Regards, > Sandro > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > From davidgshi at yahoo.co.uk Fri Oct 31 12:26:26 2008 From: davidgshi at yahoo.co.uk (David Shi) Date: Fri, 31 Oct 2008 11:26:26 +0000 (GMT) Subject: [Python.NET] Looking for a Python Ajax Middleware script Message-ID: <927519.26647.qm@web26308.mail.ukl.yahoo.com> Has anyone?tried the following with Python? ? 1. Put a code into the script like Feedback.? The code is actually a data processing program/script, which runs about 1 or 2 minutes, generates a new file on the server for users to download. Or the code/script of data processing sits outside and can be called/fired off to run within something like the feedback.? It does the same thing as I stated above. ? 2.? While data processing is going on, there will be no data passed back from the server to clients.? How do we have a screen for end users to look at and telling them that data processing is going on??? Perhaps a cranking engine turning. ? 3.? Automated registration, authentication and session management?? Linking to registration and authentication is an automated process of allocating temporary folders for each user on the server? ? Have you come across to these? ? Frankly speaking, I am not a programmer, but got thrown into the situation. ? I am using IIS 6.0 and Windows Server 2003.?? It can allow Microsoft's .NET service.? ? I think that what ideally I need is a Python middleware script which manages the dynamic UI interfaces and data processing engines. ? Your suggestions and recommendations will be deeply appreciated. ? Sincerely, ? David ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidgshi at yahoo.co.uk Fri Oct 31 12:44:21 2008 From: davidgshi at yahoo.co.uk (David Shi) Date: Fri, 31 Oct 2008 11:44:21 +0000 (GMT) Subject: [Python.NET] Looking for a generic XMLrequest and data extraction script Message-ID: <866861.22707.qm@web26306.mail.ukl.yahoo.com> Hello, ? I am also looking for a Python script to do the following: ? Send an http request to a remote geodata server and read the data into our existing Python geoprocessing scripts. ? Is there a generic script available so that I can customise it for the project in hand? ? Sincerely, ? David -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidgshi at yahoo.co.uk Thu Oct 30 19:28:28 2008 From: davidgshi at yahoo.co.uk (David Shi) Date: Thu, 30 Oct 2008 18:28:28 +0000 (GMT) Subject: [Python.NET] Looking for a Python Ajax Middleware script Message-ID: <739811.81128.qm@web26307.mail.ukl.yahoo.com> Have you tried the following with Python? ? 1. Put a code into the script like Feedback.? The code is actually a data processing program/script, which runs about 1 or 2 minutes, generates a new file on the server for users to download. Or the code/script of data processing sits outside and can be called/fired off to run within something like the feedback.? It does the same thing as I stated above. ? 2.? While data processing is going on, there will be no data passed back from the server to clients.? How do we have a screen for end users to look at and telling them that data processing is going on??? Perhaps a cranking engine turning. ? 3.? Automated registration, authentication and session management?? Linking to registration and authentication is an automated process of allocating temporary folders for each user on the server? ? Have you come across to these? ? Frankly speaking, I am not a programmer, but got thrown into the situation. ? I am using IIS 6.0 and Windows Server 2003.?? It can allow Microsoft's .NET service.? ? I think that what ideally I need is a Python middleware script which manages the dynamic UI interfaces and data processing engines. ? Your suggestions and recommendations will be deeply appreciated. ? Sincerely, ? David ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mkozyarchuk at hedgeserv.com Fri Oct 31 13:30:24 2008 From: mkozyarchuk at hedgeserv.com (Maksim Kozyarchuk) Date: Fri, 31 Oct 2008 08:30:24 -0400 Subject: [Python.NET] Looking for a generic XMLrequest and data extractionscript Message-ID: <1DD6C8896F4D57458A7E31BED744620EAF774F@FDS-NYC-MAIL-01.funddevelopmentservices.com> David, This is the wrong mailing list for this question. Try posting in on stackoverflow.com ----- Original Message ----- From: pythondotnet-bounces+mkozyarchuk=funddevelopmentservices.com at python.org To: pythondotnet at python.org Sent: Fri Oct 31 07:44:21 2008 Subject: [Python.NET] Looking for a generic XMLrequest and data extractionscript Hello, I am also looking for a Python script to do the following: Send an http request to a remote geodata server and read the data into our existing Python geoprocessing scripts. Is there a generic script available so that I can customise it for the project in hand? Sincerely, David -------------- next part -------------- An HTML attachment was scrubbed... URL: