From gianluigi.platino at gmail.com Thu Dec 2 10:57:53 2004 From: gianluigi.platino at gmail.com (Gianluigi Platino) Date: Thu Dec 2 10:57:56 2004 Subject: [Python.NET] In support of Python.Net Message-ID: <45a7471104120201577c1c9e1d@mail.gmail.com> Dear Brian, I am planning a complex application involving civil structures optimization. At first I looked to IronPython and Boo as glue-languages, I am now convinced that Python.Net is a better approach. Thank you for your outstanding work on Python.Net. Best regards, Gianluigi From borice23 at yahoo.com Thu Dec 2 16:41:43 2004 From: borice23 at yahoo.com (Boris Capitanu) Date: Thu Dec 2 16:41:46 2004 Subject: [Python.NET] Organizing scripts in folders Message-ID: <20041202154143.97996.qmail@web51804.mail.yahoo.com> Hello, I've been experiencing some problems when trying to invoke a script that is not located in the same folder as my .NET executable. Is there an easy modification to allow me to specify a full (or relative) pathname to the ImportModule function? Thank you... and also a big Thank You to Brian for the wonderful job he's done with this bridge. I hope he will find the time to continue development on it. (would be great if we could get more meaningful exceptions if something goes wrong - right now all I get is a PythonException, but that doesn't tell me where in the script the problem lies) Thanks, again. Boris Capitanu __________________________________ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com From torleif at tordivel.no Thu Dec 2 18:55:43 2004 From: torleif at tordivel.no (Torleif Ringsaker) Date: Thu Dec 2 18:56:08 2004 Subject: [Python.NET] Passing .NET strings containing " to Python.NET Message-ID: <078b01c4d898$29b3bbd0$22ef45c1@TDVTR4> Hello, We're using a socket connection to send information between a C++/C#-environment on one side to a Python/PythonDotNet environment on the other side. The information is packed in an XML string format. Packing and unpacking is done using the same C++/C#-code on both sides, thanks to PythonDotNet. When sending an XML string containing another XML string, any occurrences of " will cause the reminder of the string to be cut off. Replace any " with ? and the entire string is received. The curious thing is, this only happens when sending from C++/C# to the Python side. Sending the string the other way does not produce the same symptom. Ideas, anyone? Can the translation from a DotNet string to a Python string make this happen? Regards, Torleif From thane at magna-capital.com Thu Dec 2 19:31:25 2004 From: thane at magna-capital.com (Thane) Date: Thu Dec 2 19:31:29 2004 Subject: [Python.NET] Organizing scripts in folders In-Reply-To: <20041202154143.97996.qmail@web51804.mail.yahoo.com> Message-ID: <20041202183128.A89A11E4006@bag.python.org> import os import sys for root, path, files in os.walk(r'c:\python\scripts'): sys.path.append(root) I hope this is what you were looking for. --Thane > -----Original Message----- > From: pythondotnet-bounces@python.org [mailto:pythondotnet- > bounces@python.org] On Behalf Of Boris Capitanu > Sent: Thursday, December 02, 2004 8:42 AM > To: pythondotnet@python.org > Subject: [Python.NET] Organizing scripts in folders > > Hello, > > I've been experiencing some problems when trying to > invoke a script that is not located in the same folder > as my .NET executable. > > Is there an easy modification to allow me to specify a > full (or relative) pathname to the ImportModule > function? > > Thank you... and also a big Thank You to Brian for the > wonderful job he's done with this bridge. I hope he > will find the time to continue development on it. > (would be great if we could get more meaningful > exceptions if something goes wrong - right now all I > get is a PythonException, but that doesn't tell me > where in the script the problem lies) > > Thanks, again. > > Boris Capitanu > > > > __________________________________ > Do you Yahoo!? > The all-new My Yahoo! - What will yours do? > http://my.yahoo.com > _________________________________________________ > Python.NET mailing list - PythonDotNet@python.org > http://mail.python.org/mailman/listinfo/pythondotnet From brian at zope.com Fri Dec 3 16:52:12 2004 From: brian at zope.com (Brian Lloyd) Date: Fri Dec 3 16:52:26 2004 Subject: [Python.NET] Passing .NET strings containing " to Python.NET In-Reply-To: <078b01c4d898$29b3bbd0$22ef45c1@TDVTR4> Message-ID: > When sending an XML string containing another XML string, any > occurrences of > " will cause the reminder of the string to be cut off. Replace > any " with ? > and the entire string is received. The curious thing is, this > only happens > when sending from C++/C# to the Python side. Sending the string the other > way does not produce the same symptom. > > Ideas, anyone? Can the translation from a DotNet string to a > Python string > make this happen? Hi Torleif, The translation of strings is based on .NET's idea of the length of the string, and shouldn't ever be affected by the content of the string one way or the other. This is a total guess, but I'd suspect that there is some subtle escaping problem at the application layer on one side or the other... Brian Lloyd brian@zope.com V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com From torleif at tordivel.no Fri Dec 3 17:02:38 2004 From: torleif at tordivel.no (Torleif Ringsaker) Date: Fri Dec 3 17:08:06 2004 Subject: [Python.NET] Passing .NET strings containing " to Python.NET References: Message-ID: <001c01c4d952$41425b70$22ef45c1@TDVTR4> Hi, Thanks Brian, it turns out there are two different XML encoders/decoders doing their stuff, one in C++/MFC and the other in C#/DotNet. Decoding the XML on the DotNet side has been identified as the bug's nest. PythonDotNet is doing just fine on this. - Torleif ----- Original Message ----- From: "Brian Lloyd" To: "Torleif Ringsaker" ; Sent: Friday, December 03, 2004 4:52 PM Subject: RE: [Python.NET] Passing .NET strings containing " to Python.NET >> When sending an XML string containing another XML string, any >> occurrences of >> " will cause the reminder of the string to be cut off. Replace >> any " with ? >> and the entire string is received. The curious thing is, this >> only happens >> when sending from C++/C# to the Python side. Sending the string the other >> way does not produce the same symptom. >> >> Ideas, anyone? Can the translation from a DotNet string to a >> Python string >> make this happen? > > Hi Torleif, > > The translation of strings is based on .NET's idea of the length > of the string, and shouldn't ever be affected by the content of > the string one way or the other. > > This is a total guess, but I'd suspect that there is some subtle > escaping problem at the application layer on one side or the > other... > > > Brian Lloyd brian@zope.com > V.P. Engineering 540.361.1716 > Zope Corporation http://www.zope.com > > > From brian at zope.com Mon Dec 6 21:28:30 2004 From: brian at zope.com (Brian Lloyd) Date: Mon Dec 6 21:28:38 2004 Subject: [Python.NET] RE: The future of Python.NET In-Reply-To: <20041129173517.DCFC260055@ns1.zope.com> Message-ID: > I would like to encourage you to continue your excellent work on > Python.NET. It's my opinion that it will be a _long_ time before > IronPython comes close to Python.NET in terms of usability, if ever. > Here are some of my reasons for that opinion: > > > > Basically my point is that Python.NET is great and is immediately > useful, and I sincerely hope you don't abandon it. As Rumack said > in "Airplane": good luck, we're all counting on you. Thanks for the kind words! I definitely don't plan to abandon it, I just need to get myself off of the critical path as my time is somewhat unpredictable. One thing I'd like to do is get a public tracker / issue collector up to better organize and manage bugs & features - hopefully I'll be able to get that done this week. ...and stop calling me Shirley ;) Brian Lloyd brian@zope.com V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com From Michiel.vanSchoor at za.rangegate.com Tue Dec 7 15:38:49 2004 From: Michiel.vanSchoor at za.rangegate.com (Michiel.vanSchoor@za.rangegate.com) Date: Tue Dec 7 15:40:32 2004 Subject: [Python.NET] Michiel van Schoor/Rangegate is out of the office. Message-ID: I will be out of the office starting 2004/11/29 and will not return until 2005/01/10. I will respond to your message when I return. ************************************************************************************************************************************** This communication is privileged and contains confidential information intended only for the persons to whom it is addressed. Any other distribution, copying or disclosure is strictly prohibited. If you have received this message in error, please notify the sender immediately and delete the message without reading or copying it. From Michiel.vanSchoor at za.rangegate.com Tue Dec 7 15:43:03 2004 From: Michiel.vanSchoor at za.rangegate.com (Michiel.vanSchoor@za.rangegate.com) Date: Tue Dec 7 15:44:35 2004 Subject: [Python.NET] Michiel van Schoor/Rangegate is out of the office. Message-ID: I will be out of the office starting 2004/12/03 and will not return until 2005/01/10. I will respond to your message when I return. ************************************************************************************************************************************** This communication is privileged and contains confidential information intended only for the persons to whom it is addressed. Any other distribution, copying or disclosure is strictly prohibited. If you have received this message in error, please notify the sender immediately and delete the message without reading or copying it. From dbl007 at gmail.com Thu Dec 9 19:17:09 2004 From: dbl007 at gmail.com (kc cheng) Date: Thu Dec 9 19:49:32 2004 Subject: [Python.NET] PythonNet with Python 2.4 Message-ID: I am running Python 2.4. Tried using PyhonNetwith my existing python by copying python.runtime.dll and CLR.dll, but when import CLR, get error: System Error, Dynamic Module not initialized properly. Is it because incompatible with Python 2.4? Anyone use Python 2.4 with PythonNet? From brian at zope.com Thu Dec 9 20:04:54 2004 From: brian at zope.com (Brian Lloyd) Date: Thu Dec 9 20:05:15 2004 Subject: [Python.NET] PythonNet with Python 2.4 In-Reply-To: Message-ID: > I am running Python 2.4. > > Tried using PyhonNetwith my existing python by copying > python.runtime.dll and CLR.dll, but when import CLR, get error: > System Error, Dynamic Module not initialized properly. > > Is it because incompatible with Python 2.4? Anyone use Python 2.4 with > PythonNet? The current build is based on Python 2.3. I've finally had some nights to work on a b4 release in the last few weeks, and I am tentatively planning to base that on 2.4 (or make a release for each - its much less painful to do that now). Hopefully I can post that in the next few days. At any rate, 2.4 does appear to work fine (in that all the unit tests pass and all the demos run). If you're feeling lucky, you can go into your windows/system32 directory and make a *copy* of python24.dll named python23.dll. The DllImports look up the dll by name, so that might fake them out and get you running on 2.4 in the meantime. Don't do that if you actually have 2.3 installed, of course ;) Brian Lloyd brian@zope.com V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com From brian at zope.com Tue Dec 14 01:34:27 2004 From: brian at zope.com (Brian Lloyd) Date: Tue Dec 14 01:34:35 2004 Subject: [Python.NET] ANNOUNCE: Python for .NET beta 4 released Message-ID: Python for .NET 1.0 beta 4 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 Selected changes from the beta 4 release: - Updated the bundled C Python runtime and libraries to Python 2.4. - Managed classes reflected to Python now have an __doc__ attribute that contains a listing of the class constructor signatures. - Fixed a problem that made it impossible to override "special" methods like __getitem__ in subclasses of managed classes. Now the tests all pass, and there is much rejoicing. - Fixed a problem that prevented passing null (None) for array arguments. - Added support to directly iterate over objects that support IEnumerator (as well as IEnumerable). Thanks to Greg Chapman for prodding me ;) - Added a section to the README dealing with rebuilding Python for .NET against other CPython versions. - Fixed some problems with how COM-based objects are exposed and how members of inherited interfaces are exposed. Thanks to Bruce Dodson for patches on this. There is a mailing list for discussion and questions about Python for .NET at: pythondotnet@python.org. To subscribe to the mailing list or read the online archives, see: http://mail.python.org/mailman/listinfo/pythondotnet To report bugs or request features in Python for .NET, please use the PythonNet issue tracker at: http://www.zope.org/Members/Brian/PythonNet/Collector/ Brian Lloyd brian@zope.com V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com From theknio at gmail.com Tue Dec 14 02:23:50 2004 From: theknio at gmail.com (Tom Flanagan) Date: Tue Dec 14 02:23:53 2004 Subject: [Python.NET] ANNOUNCE: Python for .NET beta 4 released In-Reply-To: References: Message-ID: Thanks! Been looking forward to this. One note: the link on http://www.zope.org/Members/Brian/PythonNet/ still points to beta3, can get beta4 from http://zope.org/Members/Brian/PythonNet/Releases/PythonNet-1.0-beta4.tgz On Mon, 13 Dec 2004 19:34:27 -0500, Brian Lloyd wrote: > Python for .NET 1.0 beta 4 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 > > Selected changes from the beta 4 release: > > - Updated the bundled C Python runtime and libraries to Python 2.4. > > - Managed classes reflected to Python now have an __doc__ attribute that > contains a listing of the class constructor signatures. > > - Fixed a problem that made it impossible to override "special" methods > like __getitem__ in subclasses of managed classes. Now the tests all > pass, and there is much rejoicing. > > - Fixed a problem that prevented passing null (None) for array > arguments. > > - Added support to directly iterate over objects that support > IEnumerator > (as well as IEnumerable). Thanks to Greg Chapman for prodding me ;) > > - Added a section to the README dealing with rebuilding Python for .NET > against other CPython versions. > > - Fixed some problems with how COM-based objects are exposed and how > members of inherited interfaces are exposed. Thanks to Bruce Dodson > for patches on this. > > There is a mailing list for discussion and questions about Python > for .NET at: pythondotnet@python.org. > > To subscribe to the mailing list or read the online archives, see: > > http://mail.python.org/mailman/listinfo/pythondotnet > > To report bugs or request features in Python for .NET, please use > the PythonNet issue tracker at: > > http://www.zope.org/Members/Brian/PythonNet/Collector/ > > Brian Lloyd brian@zope.com > V.P. Engineering 540.361.1716 > Zope Corporation http://www.zope.com > > _________________________________________________ > Python.NET mailing list - PythonDotNet@python.org > http://mail.python.org/mailman/listinfo/pythondotnet > From dwight_fellman at datacard.com Tue Dec 14 16:22:40 2004 From: dwight_fellman at datacard.com (dwight_fellman@datacard.com) Date: Tue Dec 14 16:22:44 2004 Subject: [Python.NET] ANNOUNCE: Python for .NET beta 4 released In-Reply-To: <20041214110112.7B6791E401E@bag.python.org> Message-ID: We really appreciate your efforts on this. Thanks! From yketkar at cxosystems.com Tue Dec 21 10:01:00 2004 From: yketkar at cxosystems.com (Yogesh Ketkar) Date: Tue Dec 21 15:25:45 2004 Subject: [Python.NET] installer Message-ID: <000001c4e73b$97760f40$960aa8c0@abc> Hello, I already have python2.4 installed and now when i got PythonNet-1.0-beta4.tar it comes with another python.exe, is there a installation of python for dot net which runs on top of existing python installation? Regards, Yogesh -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20041221/148f28c4/attachment.html From Richard.Martin at thomson.net Tue Dec 28 21:57:06 2004 From: Richard.Martin at thomson.net (Martin Richard) Date: Tue Dec 28 21:57:40 2004 Subject: [Python.NET] AttributeError: 'MarshalByRefObject' object has no attribute ... Message-ID: <3531F1FE12C5B4489D2014F59B4669130214297E@bvtnsmail01.am.thmulti.com> This is python 2.3. I start a toy .NET service. This is a C-sharp executable. In the C-sharp files, this code exists: namespace foo { public class Toy : MarshalByRefObject, IToy ... } In python, after loading an assembly, I can successfully do either: from CLR.foo import Toy from CLR.foo import IToy I can get a string for the url of the service from the config file. I then try: # using Toy also gives the same result remoteObj = System.Activator.GetObject(IToy, url) and it returns this for remoteObj: If I try to invoke a method on remoteObj, I get this error: AttributeError: 'MarshalByRefObject' object has no attribute 'methodName'. It is almost as if the remoteObj has not been cast to the correct type (Itoy). But if I do remoteObj.ToString() it returns 'foo.Toy'. If I just try to instantiate a local instance of Toy -- t = Toy() -- this succeeds, and I can successfully invoke the method that fails on the remoteObj. Any ideas why the remoteObj is failing? Thanks, Rick From brian at zope.com Tue Dec 28 22:12:31 2004 From: brian at zope.com (Brian Lloyd) Date: Tue Dec 28 22:12:40 2004 Subject: [Python.NET] AttributeError: 'MarshalByRefObject' object has noattribute ... In-Reply-To: <3531F1FE12C5B4489D2014F59B4669130214297E@bvtnsmail01.am.thmulti.com> Message-ID: Hi Martin - Interface types, as they appear to Python, all have a single argument constructor that you can use to "cast" an object to a particular interface. Because System.Activator.GetObject() has a return type of object, the runtime returns the object as its true runtime type to Python (which happens to be MarshalByRefObject). So I think all you need to do is an "explicit cast": remoteObj = System.Activator.GetObject(IToy, url) mytoy = IToy(remoteObj) mytoy.someMethod(...) Hope this helps, Brian Lloyd brian@zope.com V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com > -----Original Message----- > From: pythondotnet-bounces+brian=zope.com@python.org > [mailto:pythondotnet-bounces+brian=zope.com@python.org]On Behalf Of > Martin Richard > Sent: Tuesday, December 28, 2004 3:57 PM > To: pythondotnet@python.org > Subject: [Python.NET] AttributeError: 'MarshalByRefObject' object has > noattribute ... > > > This is python 2.3. > > I start a toy .NET service. This is a C-sharp executable. > > In the C-sharp files, this code exists: > > namespace foo > { > public class Toy : MarshalByRefObject, IToy > ... > } > > In python, after loading an assembly, I can successfully do either: > from CLR.foo import Toy > from CLR.foo import IToy > > I can get a string for the url of the service from the config file. > > I then try: > # using Toy also gives the same result > remoteObj = System.Activator.GetObject(IToy, url) > > and it returns this for remoteObj: > > > If I try to invoke a method on remoteObj, I get this error: > AttributeError: 'MarshalByRefObject' object has no attribute > 'methodName'. > > It is almost as if the remoteObj has not been cast to the correct type > (Itoy). But if I do remoteObj.ToString() it returns 'foo.Toy'. > > If I just try to instantiate a local instance of Toy -- > t = Toy() > -- this succeeds, and I can successfully invoke the method that fails on > the remoteObj. > > Any ideas why the remoteObj is failing? > > Thanks, > > Rick > > > > > > _________________________________________________ > Python.NET mailing list - PythonDotNet@python.org > http://mail.python.org/mailman/listinfo/pythondotnet > From Richard.Martin at thomson.net Tue Dec 28 22:59:04 2004 From: Richard.Martin at thomson.net (Martin Richard) Date: Tue Dec 28 22:59:39 2004 Subject: [Python.NET] AttributeError: 'MarshalByRefObject' object has noattribute ... Message-ID: <3531F1FE12C5B4489D2014F59B46691301D34E89@bvtnsmail01.am.thmulti.com> Thanks for the fast reply. The pseudo-cast did it. I'd wonder why trying Itoy() gave complaints about needing an argument. Rick -----Original Message----- From: Brian Lloyd [mailto:brian@zope.com] Sent: Tuesday, December 28, 2004 1:13 PM To: Martin Richard; pythondotnet@python.org Subject: RE: [Python.NET] AttributeError: 'MarshalByRefObject' object has noattribute ... Hi Martin - Interface types, as they appear to Python, all have a single argument constructor that you can use to "cast" an object to a particular interface. Because System.Activator.GetObject() has a return type of object, the runtime returns the object as its true runtime type to Python (which happens to be MarshalByRefObject). So I think all you need to do is an "explicit cast": remoteObj = System.Activator.GetObject(IToy, url) mytoy = IToy(remoteObj) mytoy.someMethod(...) Hope this helps, Brian Lloyd brian@zope.com V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com > -----Original Message----- > From: pythondotnet-bounces+brian=zope.com@python.org > [mailto:pythondotnet-bounces+brian=zope.com@python.org]On Behalf Of > Martin Richard > Sent: Tuesday, December 28, 2004 3:57 PM > To: pythondotnet@python.org > Subject: [Python.NET] AttributeError: 'MarshalByRefObject' object has > noattribute ... > > > This is python 2.3. > > I start a toy .NET service. This is a C-sharp executable. > > In the C-sharp files, this code exists: > > namespace foo > { > public class Toy : MarshalByRefObject, IToy > ... > } > > In python, after loading an assembly, I can successfully do either: > from CLR.foo import Toy > from CLR.foo import IToy > > I can get a string for the url of the service from the config file. > > I then try: > # using Toy also gives the same result > remoteObj = System.Activator.GetObject(IToy, url) > > and it returns this for remoteObj: > > > If I try to invoke a method on remoteObj, I get this error: > AttributeError: 'MarshalByRefObject' object has no attribute > 'methodName'. > > It is almost as if the remoteObj has not been cast to the correct type > (Itoy). But if I do remoteObj.ToString() it returns 'foo.Toy'. > > If I just try to instantiate a local instance of Toy -- > t = Toy() > -- this succeeds, and I can successfully invoke the method that fails > on the remoteObj. > > Any ideas why the remoteObj is failing? > > Thanks, > > Rick > > > > > > _________________________________________________ > Python.NET mailing list - PythonDotNet@python.org > http://mail.python.org/mailman/listinfo/pythondotnet > From amod.kulkarni at neilsoft.com Wed Dec 29 13:28:53 2004 From: amod.kulkarni at neilsoft.com (Amod Kulkarni) Date: Wed Dec 29 15:23:11 2004 Subject: [Python.NET] Embedded scripting Message-ID: Hi, I am new to PythonNet and am experimenting a little bit with it. Basically I am trying to call python function from C# code with the help of Python.Runtime DLL. I was able to import a python module in C# and call one of its functions. But this works fine only when the module supplied to PythonEngine.ImportMOdule() function is physically existing. What if I want to import a module that does not physically exist but is merged in some other application?s EXE? Is there any way to load such a module using PythonEngine.ImportMOdule()? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20041229/23091829/attachment.htm