From Michael.Gogins at sungard.com Thu Feb 5 17:30:20 2004 From: Michael.Gogins at sungard.com (Michael.Gogins@sungard.com) Date: Fri Feb 6 09:31:23 2004 Subject: [Python.NET] How to interrupt Python from a .NET program? Message-ID: I have written a Python script editor in C#. It runs a script using PythonEngine.RunSimpleString(). I need to be able to interrupt the script execution fromC#, but I haven't been able to figure out how to do it without crashing the process. If I try to finalize the PythonEngine, or raise a keyboard interrupt, either in the GUI thread, or in a Python callback thread (a C# delegate), I get: Fatal Python error: PyThreadState_Get: no current thread Thanks for any light anyone can shed on this. From amorgan at aliensolutions.com Fri Feb 6 09:52:00 2004 From: amorgan at aliensolutions.com (Allen Morgan) Date: Fri Feb 6 09:56:49 2004 Subject: [Python.NET] Newbie question... Message-ID: <5EF12511946F5648BF727630C937012A091AF7@minime.hq.aliensolutions.com> This might be a fairly trivial question but its one I haven't been able to answer from other postings. I suspect that the answer is no but: Can I call c# classes from an embedded python module and also vice-versa? And does anyone know if the work that was done at ActiveState is going to progress? That would be best, but if the above is possible I think that would be great for our developments. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20040206/813a02df/attachment.html From brian at zope.com Fri Feb 6 09:56:11 2004 From: brian at zope.com (Brian Lloyd) Date: Fri Feb 6 09:56:56 2004 Subject: [Python.NET] How to interrupt Python from a .NET program? In-Reply-To: Message-ID: > I have written a Python script editor in C#. It runs a script > using PythonEngine.RunSimpleString(). > > I need to be able to interrupt the script execution fromC#, but I > haven't been able to figure out how to do it without crashing the process. > > If I try to finalize the PythonEngine, or raise a keyboard > interrupt, either in the GUI thread, or in a Python callback > thread (a C# delegate), I get: > > Fatal Python error: PyThreadState_Get: no current thread > > Thanks for any light anyone can shed on this. Hmm - this probably indicates something I need to fix. In the meantime, you can try calling PythonEngine.EnsureThread() from the thread you are using before trying to interrupt - that should at least make sure that Python knows about the thread. It may still fail, but at least it should fail with a different error ;^) Brian Lloyd brian@zope.com V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com From vanevery at indiegamedesign.com Sat Feb 7 05:16:26 2004 From: vanevery at indiegamedesign.com (Brandon J. Van Every) Date: Sat Feb 7 05:05:17 2004 Subject: [Python.NET] Newbie question... In-Reply-To: <5EF12511946F5648BF727630C937012A091AF7@minime.hq.aliensolutions.com> Message-ID: > This might be a fairly trivial question but its one I haven't been able to answer from other postings. I suspect that the answer is no but: Can I call c# classes from an embedded python module and also vice-versa? Python can call .NET, .NET can't call Python. > And does anyone know if the work that was done at ActiveState is going to progress? That would be best, but if the above is possible I think that would be great for our developments. My understanding is it won't go anywhere. Python is too different from the CIL for it to be practical. Instead Microsoft will have to come up with a more advanced CIL, more capable of supporting dynamic languages. Cheers, www.indiegamedesign.com Brandon Van Every Seattle, WA 20% of the world is real. 80% is gobbledygook we make up inside our own heads. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.572 / Virus Database: 362 - Release Date: 1/27/2004 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20040207/a8d8ad39/attachment.html From gerainthuwwilliams at hotmail.com Wed Feb 18 05:13:47 2004 From: gerainthuwwilliams at hotmail.com (Geraint Williams) Date: Mon Feb 23 09:37:47 2004 Subject: [Python.NET] importing Assembly Message-ID: I see that this has been asked before, but I must be missing something >>>import CLR.Company.Product.Module Traceback (most recent call last): File "", line 1, in ? ImportError: No module named Company The dll I have is called: "Company.Product.Module.dll", and is copied into the python root dir The source code for the module defines namespace as "namespace Company.Product.Module" Also I try the following: >>>from CLR.System.Reflection import Assembly >>>a = Assembly.LoadWithPartialName('Company.Product.Module') >>>import CLR.Company.Product.Module Traceback (most recent call last): File "", line 1, in ? ImportError: No module named Company please excuse any obvious ignorance of .NET terminology, it's something I've just started looking at. Thanks, Geraint _________________________________________________________________ Tired of 56k? Get a FREE BT Broadband connection http://www.msn.co.uk/specials/btbroadband From brian at zope.com Tue Feb 24 22:00:53 2004 From: brian at zope.com (Brian Lloyd) Date: Tue Feb 24 22:01:03 2004 Subject: [Python.NET] importing Assembly In-Reply-To: Message-ID: > I see that this has been asked before, but I must be missing something > > >>>import CLR.Company.Product.Module > Traceback (most recent call last): > File "", line 1, in ? > ImportError: No module named Company > > The dll I have is called: "Company.Product.Module.dll", and is > copied into > the python root dir > > The source code for the module defines namespace as "namespace > Company.Product.Module" > > Also I try the following: > > >>>from CLR.System.Reflection import Assembly > >>>a = Assembly.LoadWithPartialName('Company.Product.Module') > >>>import CLR.Company.Product.Module > Traceback (most recent call last): > File "", line 1, in ? > ImportError: No module named Company > > please excuse any obvious ignorance of .NET terminology, it's > something I've > just started looking at. Sorry I'm late on this - my spam filter starting eating some of my mailing list email a week or so ago and I'm still catching up :( I'm curious whether you can use reflection to loop over the types defined in your assembly after using LoadWithPartialName to load it. What you are doing looks like it _should_ work fine. Brian Lloyd brian@zope.com V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com From gerainthuwwilliams at hotmail.com Wed Feb 25 03:12:51 2004 From: gerainthuwwilliams at hotmail.com (Geraint Williams) Date: Wed Feb 25 03:12:55 2004 Subject: [Python.NET] importing Assembly Message-ID: Hi, thanks for the response but have already solved the problem. The Assembly (which I had copied to the python dir) referenced another assembly (which I had not - although I think I may have been included in my path). Copying the referenced assembly to my python dir did the trick. Anyway, thanks for the product... has made my life (testing a .NET assembly) far easier. Find it far more productive writing test scripts in a scripting language than in C# development environment. Cheers, Geraint. >From: "Brian Lloyd" >To: "Geraint Williams" >, >Subject: RE: [Python.NET] importing Assembly >Date: Tue, 24 Feb 2004 22:00:53 -0500 > > > I see that this has been asked before, but I must be missing something > > > > >>>import CLR.Company.Product.Module > > Traceback (most recent call last): > > File "", line 1, in ? > > ImportError: No module named Company > > > > The dll I have is called: "Company.Product.Module.dll", and is > > copied into > > the python root dir > > > > The source code for the module defines namespace as "namespace > > Company.Product.Module" > > > > Also I try the following: > > > > >>>from CLR.System.Reflection import Assembly > > >>>a = Assembly.LoadWithPartialName('Company.Product.Module') > > >>>import CLR.Company.Product.Module > > Traceback (most recent call last): > > File "", line 1, in ? > > ImportError: No module named Company > > > > please excuse any obvious ignorance of .NET terminology, it's > > something I've > > just started looking at. > >Sorry I'm late on this - my spam filter starting eating some >of my mailing list email a week or so ago and I'm still catching >up :( > >I'm curious whether you can use reflection to loop over the types >defined in your assembly after using LoadWithPartialName to load >it. What you are doing looks like it _should_ work fine. > >Brian Lloyd brian@zope.com >V.P. Engineering 540.361.1716 >Zope Corporation http://www.zope.com > > _________________________________________________________________ Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo From akaiser at vocote.de Wed Feb 25 17:29:31 2004 From: akaiser at vocote.de (Andreas Kaiser) Date: Wed Feb 25 17:40:17 2004 Subject: [Python.NET] Using an existing Python installation In-Reply-To: References: Message-ID: Hi Brian, Brian Lloyd wrote: >> So this fails: >> >> from CLR.System.Reflection import Assembly >> Assembly.LoadWithPartialName('SomeNamespace') >> import CLR.SomeNamespace as SomeNamespace >> >> But this works: >> >> import CLR >> from CLR.System.Reflection import Assembly >> Assembly.LoadWithPartialName('SomeNamespace') >> import CLR.SomeNamespace as SomeNamespace > > Hi Mike - yes, I've already got this one in the bug hopper for b2. It > has to do with the trickery I'm using to install the import hook not > being quite tricky enough when it happens in an already-running > interpreter. I felt into this trap too. The bug is also in beta3. With the line import CLR on top everything is working well. Another point is that it was neccessary to copy the CLR.dll to PythonRoot\DLLs and not only to PythonRoot (as written in the README). WinXP HOME SP1, Python 2.3.3, PythonNet 1.0 beta 3 HTH Andreas From glc at well.com Wed Feb 25 20:09:06 2004 From: glc at well.com (Greg Chapman) Date: Wed Feb 25 20:30:54 2004 Subject: [Python.NET] buglet in module importing Message-ID: I just ran into this using the PythonNet-1.0-beta3 release. If you start interactive Python and do this: >>> import CLR.System.Resources No error is raised. However, the import has in fact failed: >>> from CLR.System.Threading import Thread >>> assemblies = Thread.GetDomain().GetAssemblies() >>> [a.FullName.split(',', 1)[0] for a in assemblies] [u'mscorlib', u'python', u'Python.Runtime', u'e__NativeCall_Assembly', u'System', u'System.Xml']. The System.Resources module is in the System.Windows.Forms assembly, but as you can see, that assembly has not been loaded. I believe the problem is that the above import statement ultimately ends up in a call to Assembly.LoadWithPartialName("System.Resources"). This fails because there is no such assembly. For some reason, this failure does not seem to be raising a Python exception, though I think it should. The workaround is to import System.Windows.Forms before importing System.Resources. --- Greg Chapman From srussell at lotmate.com Fri Feb 27 08:57:31 2004 From: srussell at lotmate.com (Stephen Russell) Date: Fri Feb 27 09:03:22 2004 Subject: [Python.NET] Anyone or anything happening here? Message-ID: <000a01c3fd39$a552b510$0d3c19ac@CHDOB.PARKER.COM> I was interested in seeing if Python on .NET was possible? Stephen Russell S.R. & Associates Memphis TN 38115 901.246-0159 "Most people hate the taste of beer - to begin with. It is, however, a prejudice that many people have been able to overcome." --Winston Churchill From hawkeye.parker at autodesk.com Fri Feb 27 13:05:56 2004 From: hawkeye.parker at autodesk.com (Hawkeye Parker) Date: Fri Feb 27 13:06:02 2004 Subject: [Python.NET] Anyone or anything happening here? Message-ID: <9BDC80F712DD0C4CB5FBF48D2ED3DD8B44AEF5@msgusawmb02.ads.autodesk.com> http://www.zope.org/Members/Brian/PythonNet/index_html AFAIK, this is the only fully working (beta) implementation of anything Python > .Net. take a look at the link contents for details on this implementation. basically, it allows CPython access to .Net, but not the other way around. it is not "Python.Net", but CPython *for* .Net . . . . IMHO, it's quite good, and others on the list seem to like what it does/how it works. > -----Original Message----- > From: pythondotnet-bounces@python.org > [mailto:pythondotnet-bounces@python.org]On Behalf Of Stephen Russell > Sent: Friday, February 27, 2004 5:58 AM > To: pythondotnet@python.org > Subject: [Python.NET] Anyone or anything happening here? > > > I was interested in seeing if Python on .NET was possible? > > Stephen Russell > S.R. & Associates > Memphis TN 38115 > 901.246-0159 > > "Most people hate the taste of beer - to begin with. It is, however, a > prejudice that many people have been able to overcome." > --Winston Churchill > > > _________________________________________________ > Python.NET mailing list - PythonDotNet@python.org > http://mail.python.org/mailman/listinfo/pythondotnet > From brian at zope.com Fri Feb 27 13:26:30 2004 From: brian at zope.com (Brian Lloyd) Date: Fri Feb 27 13:26:44 2004 Subject: [Python.NET] Anyone or anything happening here? In-Reply-To: <9BDC80F712DD0C4CB5FBF48D2ED3DD8B44AEF5@msgusawmb02.ads.autodesk.com> Message-ID: > AFAIK, this is the only fully working (beta) implementation of > anything Python > .Net. take a look at the link contents for > details on this implementation. basically, it allows CPython > access to .Net, but not the other way around. it is not > "Python.Net", but CPython *for* .Net . . . . IMHO, it's quite > good, and others on the list seem to like what it does/how it works. btw, I have a beta 4 (mainly bug fixes) all but ready to go - I just need to get time to package it and post it. Brian Lloyd brian@zope.com V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com > -----Original Message----- > From: pythondotnet-bounces@python.org > [mailto:pythondotnet-bounces@python.org]On Behalf Of Hawkeye Parker > Sent: Friday, February 27, 2004 1:06 PM > To: srussell@lotmate.com; pythondotnet@python.org > Subject: RE: [Python.NET] Anyone or anything happening here? > > > http://www.zope.org/Members/Brian/PythonNet/index_html > > AFAIK, this is the only fully working (beta) implementation of > anything Python > .Net. take a look at the link contents for > details on this implementation. basically, it allows CPython > access to .Net, but not the other way around. it is not > "Python.Net", but CPython *for* .Net . . . . IMHO, it's quite > good, and others on the list seem to like what it does/how it works. > > > > -----Original Message----- > > From: pythondotnet-bounces@python.org > > [mailto:pythondotnet-bounces@python.org]On Behalf Of Stephen Russell > > Sent: Friday, February 27, 2004 5:58 AM > > To: pythondotnet@python.org > > Subject: [Python.NET] Anyone or anything happening here? > > > > > > I was interested in seeing if Python on .NET was possible? > > > > Stephen Russell > > S.R. & Associates > > Memphis TN 38115 > > 901.246-0159 > > > > "Most people hate the taste of beer - to begin with. It is, however, a > > prejudice that many people have been able to overcome." > > --Winston Churchill > > > > > > _________________________________________________ > > Python.NET mailing list - PythonDotNet@python.org > > http://mail.python.org/mailman/listinfo/pythondotnet > > > > _________________________________________________ > Python.NET mailing list - PythonDotNet@python.org > http://mail.python.org/mailman/listinfo/pythondotnet > From MBarclay at cri-inc.com Fri Feb 27 14:03:25 2004 From: MBarclay at cri-inc.com (MBarclay@cri-inc.com) Date: Fri Feb 27 14:03:29 2004 Subject: [Python.NET] Anyone or anything happening here? Message-ID: Actually, Hawkeye (and the OP) , it's yet a bit more than that. I agree that "it is not "Python.Net"" (it does not make Python run as a .NET language), but it does allow you to embed Python in a .NET app. In fact, as you're probably aware, the python.exe that you run when using Python for .NET in the conventional way (see documented examples) is a simple example of embedding Python in a (very small) .NET app, which in turn provides access to a very rich interface for calling back in the other direction. The viewpoint one has while using Python for .NET in the conventional way (running the CLR-enabled python.exe, importing CLR, and going from there) is that the CLR is acting as an appendage to Python. But in fact there is a duality in this architecture that is subtle but amazingly flexible. You might say that in this clever framework, Python and .NET are mutually embedded, which offers some unique possibilities similar to, but even more powerful than, Jython. BTW, Jython is pretty cool too, but I prefer Python for .NET because it is real CPython, so almost anything that you could do in Python before integrating it with .NET, you can still do. In Jython, any python code has to be available in source form so it can be compiled by Jython (at least once) whereasany Python byte code that works with the currently supported Python runtime (2.3 currently) will work with Python for .NET. The somewhat downplayed embedding capability is the aspect of Python for .NET that I am personally finding very useful, with the "calling back to .NET" feature being a very nice bonus, allowing the embedding .NET app to use Python to allow it to sort-of "script into itself". P.S. -- I am not contradicting you (your answer to the OP is completely correct) -- I'm just adding a viewpoint that I have found useful. ========================== Mark Barclay Sr. Software Engineer, CRi Inc. |---------+-------------------------------> | | "Hawkeye Parker" | | | | | | Sent by: | | | pythondotnet-bounces| | | @python.org | | | | | | | | | 02/27/2004 01:05 PM | | | | |---------+-------------------------------> >-------------------------------------------------------------------------------------------------------------------| | | | To: , | | cc: | | Subject: RE: [Python.NET] Anyone or anything happening here? | >-------------------------------------------------------------------------------------------------------------------| http://www.zope.org/Members/Brian/PythonNet/index_html AFAIK, this is the only fully working (beta) implementation of anything Python > .Net. take a look at the link contents for details on this implementation. basically, it allows CPython access to .Net, but not the other way around. it is not "Python.Net", but CPython *for* .Net . . . . IMHO, it's quite good, and others on the list seem to like what it does/how it works. From hawkeye.parker at autodesk.com Fri Feb 27 14:17:57 2004 From: hawkeye.parker at autodesk.com (Hawkeye Parker) Date: Fri Feb 27 14:18:04 2004 Subject: [Python.NET] Anyone or anything happening here? Message-ID: <9BDC80F712DD0C4CB5FBF48D2ED3DD8B02006D24@msgusawmb02.ads.autodesk.com> i agree %100, and your explanation does true justice to this excellent framework. thanks for taking the time, hawkeye > -----Original Message----- > From: MBarclay@cri-inc.com [mailto:MBarclay@cri-inc.com] > Sent: Friday, February 27, 2004 11:03 AM > To: Hawkeye Parker > Cc: pythondotnet@python.org; pythondotnet-bounces@python.org; > srussell@lotmate.com > Subject: RE: [Python.NET] Anyone or anything happening here? > > > > Actually, Hawkeye (and the OP) , it's yet a bit more than > that. I agree > that "it is not "Python.Net"" (it does not make Python run as a .NET > language), but it does allow you to embed Python in a .NET > app. In fact, as > you're probably aware, the python.exe that you run when using > Python for > .NET in the conventional way (see documented examples) is a > simple example > of embedding Python in a (very small) .NET app, which in turn provides > access to a very rich interface for calling back in the other > direction. > > The viewpoint one has while using Python for .NET in the > conventional way > (running the CLR-enabled python.exe, importing CLR, and going > from there) > is that the CLR is acting as an appendage to Python. But in > fact there is a > duality in this architecture that is subtle but amazingly > flexible. You > might say that in this clever framework, Python and .NET are mutually > embedded, which offers some unique possibilities similar to, > but even more > powerful than, Jython. > > BTW, Jython is pretty cool too, but I prefer Python for .NET > because it is > real CPython, so almost anything that you could do in Python before > integrating it with .NET, you can still do. In Jython, any > python code has > to be available in source form so it can be compiled by > Jython (at least > once) whereasany Python byte code that works with the > currently supported > Python runtime (2.3 currently) will work with Python for .NET. > > The somewhat downplayed embedding capability is the aspect of > Python for > .NET that I am personally finding very useful, with the > "calling back to > .NET" feature being a very nice bonus, allowing the embedding > .NET app to > use Python to allow it to sort-of "script into itself". > > > P.S. -- I am not contradicting you (your answer to the OP is > completely > correct) -- I'm just adding a viewpoint that I have found useful. > > ========================== > Mark Barclay > Sr. Software Engineer, CRi Inc. > > > > |---------+-------------------------------> > | | "Hawkeye Parker" | > | | | | desk.com> | > | | Sent by: | > | | pythondotnet-bounces| > | | @python.org | > | | | > | | | > | | 02/27/2004 01:05 PM | > | | | > |---------+-------------------------------> > > >------------------------------------------------------------- > ------------------------------------------------------| > | > | > | To: , > > | > | cc: > | > | Subject: RE: [Python.NET] Anyone or anything > happening here? | > > >------------------------------------------------------------- > ------------------------------------------------------| > > > > > http://www.zope.org/Members/Brian/PythonNet/index_html > > AFAIK, this is the only fully working (beta) implementation > of anything > Python > .Net. take a look at the link contents for details on this > implementation. basically, it allows CPython access to .Net, > but not the > other way around. it is not "Python.Net", but CPython *for* > .Net . . . . > IMHO, it's quite good, and others on the list seem to like > what it does/how > it works. > > > > > > From paniq at gmx.net Fri Feb 27 16:04:41 2004 From: paniq at gmx.net (Leonard :paniq: Ritter) Date: Fri Feb 27 16:04:47 2004 Subject: [Python.NET] Anyone or anything happening here? Message-ID: <403595317.20040227220441@gmx.net> (whoops, sent to individual instead of mailing list first) i heard a lot of this mysterious "CPython", could anybody give me a hint on how to get it and check it out? google doesnt give me useful resuls. would be charming, if it is an x86 compiler for a typed python dialect :) -- Leonard Ritter -- paniq@gmx.net -- http://www.paniq.de -- http://www.the-mu.com Friday, February 27, 2004, 8:03:25 PM, you wrote: Mcic> Actually, Hawkeye (and the OP) , it's yet a bit more than that. I agree Mcic> that "it is not "Python.Net"" (it does not make Python run as a .NET Mcic> language), but it does allow you to embed Python in a .NET app. In fact, as Mcic> you're probably aware, the python.exe that you run when using Python for Mcic> .NET in the conventional way (see documented examples) is a simple example Mcic> of embedding Python in a (very small) .NET app, which in turn provides Mcic> access to a very rich interface for calling back in the other direction. Mcic> The viewpoint one has while using Python for .NET in the conventional way Mcic> (running the CLR-enabled python.exe, importing CLR, and going from there) Mcic> is that the CLR is acting as an appendage to Python. But in fact there is a Mcic> duality in this architecture that is subtle but amazingly flexible. You Mcic> might say that in this clever framework, Python and .NET are mutually Mcic> embedded, which offers some unique possibilities similar to, but even more Mcic> powerful than, Jython. Mcic> BTW, Jython is pretty cool too, but I prefer Python for .NET because it is Mcic> real CPython, so almost anything that you could do in Python before Mcic> integrating it with .NET, you can still do. In Jython, any python code has Mcic> to be available in source form so it can be compiled by Jython (at least Mcic> once) whereasany Python byte code that works with the currently supported Mcic> Python runtime (2.3 currently) will work with Python for .NET. Mcic> The somewhat downplayed embedding capability is the aspect of Python for Mcic> .NET that I am personally finding very useful, with the "calling back to Mcic> .NET" feature being a very nice bonus, allowing the embedding .NET app to Mcic> use Python to allow it to sort-of "script into itself". Mcic> P.S. -- I am not contradicting you (your answer to the OP is completely Mcic> correct) -- I'm just adding a viewpoint that I have found useful. Mcic> ========================== Mcic> Mark Barclay Mcic> Sr. Software Engineer, CRi Inc. Mcic> |---------+-------------------------------> Mcic> | | "Hawkeye Parker" | Mcic> | | | | desk.com> | Mcic> | | Sent by: | Mcic> | | pythondotnet-bounces| Mcic> | | @python.org | Mcic> | | | Mcic> | | | Mcic> | | 02/27/2004 01:05 PM | Mcic> | | | Mcic> |---------+-------------------------------> Mcic> Mcic> >-------------------------------------------------------------------------------------------------------------------| Mcic> | Mcic> | To: , Mcic> Mcic> | cc: Mcic> | Subject: RE: [Python.NET] Anyone or anything Mcic> happening here? | Mcic> Mcic> >-------------------------------------------------------------------------------------------------------------------| Mcic> http://www.zope.org/Members/Brian/PythonNet/index_html Mcic> AFAIK, this is the only fully working (beta) implementation of anything Python >> .Net. take a look at the link contents for details on this Mcic> implementation. basically, it allows CPython access to .Net, but not the Mcic> other way around. it is not "Python.Net", but CPython *for* .Net . . . . Mcic> IMHO, it's quite good, and others on the list seem to like what it does/how Mcic> it works. Mcic> _________________________________________________ Mcic> Python.NET mailing list - PythonDotNet@python.org Mcic> http://mail.python.org/mailman/listinfo/pythondotnet From hawkeye.parker at autodesk.com Fri Feb 27 16:36:46 2004 From: hawkeye.parker at autodesk.com (Hawkeye Parker) Date: Fri Feb 27 16:37:02 2004 Subject: [Python.NET] Anyone or anything happening here? Message-ID: <9BDC80F712DD0C4CB5FBF48D2ED3DD8B44AEF8@msgusawmb02.ads.autodesk.com> http://www.python.org "python" is "cpython" when people talk about jpython or python.net or any other python, they use "cpython" to explicitly refer to THE "original" python. i believe this is because the low level python (cpython) libs and python interpreter are written in C. > -----Original Message----- > From: pythondotnet-bounces@python.org > [mailto:pythondotnet-bounces@python.org]On Behalf Of Leonard :paniq: > Ritter > Sent: Friday, February 27, 2004 1:05 PM > To: PythonDotNet@python.org > Subject: Re[2]: [Python.NET] Anyone or anything happening here? > > > > (whoops, sent to individual instead of mailing list first) > > i heard a lot of this mysterious "CPython", could anybody give me a > hint on how to get it and check it out? google doesnt give me useful > resuls. > > would be charming, if it is an x86 compiler for a typed python dialect > :) > > -- Leonard Ritter > -- paniq@gmx.net > -- http://www.paniq.de > -- http://www.the-mu.com > > Friday, February 27, 2004, 8:03:25 PM, you wrote: > > > Mcic> Actually, Hawkeye (and the OP) , it's yet a bit more > than that. I agree > Mcic> that "it is not "Python.Net"" (it does not make Python > run as a .NET > Mcic> language), but it does allow you to embed Python in a > .NET app. In fact, as > Mcic> you're probably aware, the python.exe that you run when > using Python for > Mcic> .NET in the conventional way (see documented examples) > is a simple example > Mcic> of embedding Python in a (very small) .NET app, which > in turn provides > Mcic> access to a very rich interface for calling back in the > other direction. > > Mcic> The viewpoint one has while using Python for .NET in > the conventional way > Mcic> (running the CLR-enabled python.exe, importing CLR, and > going from there) > Mcic> is that the CLR is acting as an appendage to Python. > But in fact there is a > Mcic> duality in this architecture that is subtle but > amazingly flexible. You > Mcic> might say that in this clever framework, Python and > .NET are mutually > Mcic> embedded, which offers some unique possibilities > similar to, but even more > Mcic> powerful than, Jython. > > Mcic> BTW, Jython is pretty cool too, but I prefer Python for > .NET because it is > Mcic> real CPython, so almost anything that you could do in > Python before > Mcic> integrating it with .NET, you can still do. In Jython, > any python code has > Mcic> to be available in source form so it can be compiled by > Jython (at least > Mcic> once) whereasany Python byte code that works with the > currently supported > Mcic> Python runtime (2.3 currently) will work with Python for .NET. > > Mcic> The somewhat downplayed embedding capability is the > aspect of Python for > Mcic> .NET that I am personally finding very useful, with the > "calling back to > Mcic> .NET" feature being a very nice bonus, allowing the > embedding .NET app to > Mcic> use Python to allow it to sort-of "script into itself". > > > Mcic> P.S. -- I am not contradicting you (your answer to the > OP is completely > Mcic> correct) -- I'm just adding a viewpoint that I have > found useful. > > Mcic> ========================== > Mcic> Mark Barclay > Mcic> Sr. Software Engineer, CRi Inc. > > > > Mcic> |---------+-------------------------------> > Mcic> | | "Hawkeye Parker" | > Mcic> | | Mcic> | | desk.com> | > Mcic> | | Sent by: | > Mcic> | | pythondotnet-bounces| > Mcic> | | @python.org | > Mcic> | | | > Mcic> | | | > Mcic> | | 02/27/2004 01:05 PM | > Mcic> | | | > Mcic> |---------+-------------------------------> > Mcic> > Mcic> > >------------------------------------------------------------- > ------------------------------------------------------| > Mcic> | > Mcic> | To: , > Mcic> > Mcic> | cc: > Mcic> | Subject: RE: [Python.NET] Anyone or anything > Mcic> happening here? | > Mcic> > Mcic> > >------------------------------------------------------------- > ------------------------------------------------------| > > > > > Mcic> http://www.zope.org/Members/Brian/PythonNet/index_html > > Mcic> AFAIK, this is the only fully working (beta) > implementation of anything > Python >> .Net. take a look at the link contents for details on this > Mcic> implementation. basically, it allows CPython access to > .Net, but not the > Mcic> other way around. it is not "Python.Net", but CPython > *for* .Net . . . . > Mcic> IMHO, it's quite good, and others on the list seem to > like what it does/how > Mcic> it works. > > > > > > > Mcic> _________________________________________________ > Mcic> Python.NET mailing list - PythonDotNet@python.org > Mcic> http://mail.python.org/mailman/listinfo/pythondotnet > > > > _________________________________________________ > Python.NET mailing list - PythonDotNet@python.org > http://mail.python.org/mailman/listinfo/pythondotnet > From paniq at gmx.net Fri Feb 27 16:47:49 2004 From: paniq at gmx.net (Leonard :paniq: Ritter) Date: Fri Feb 27 16:47:55 2004 Subject: [Python.NET] Anyone or anything happening here? In-Reply-To: <9BDC80F712DD0C4CB5FBF48D2ED3DD8B44AEF8@msgusawmb02.ads.autodesk.com> References: <9BDC80F712DD0C4CB5FBF48D2ED3DD8B44AEF8@msgusawmb02.ads.autodesk.com> Message-ID: <778972756.20040227224749@gmx.net> i know that is a bit offtopic but: does something like a strong-typed x86 c++/python cross-compiler exist? or something that lies on the path to it? if yes, that would be rule. if no, would anyone of you like that idea? -- Leonard Ritter -- paniq@gmx.net -- http://www.paniq.de -- http://www.the-mu.com Friday, February 27, 2004, 10:36:46 PM, you wrote: HP> http://www.python.org HP> "python" is "cpython" HP> when people talk about jpython or python.net or any other HP> python, they use "cpython" to explicitly refer to THE "original" HP> python. i believe this is because the low level python (cpython) HP> libs and python interpreter are written in C. >> -----Original Message----- >> From: pythondotnet-bounces@python.org >> [mailto:pythondotnet-bounces@python.org]On Behalf Of Leonard :paniq: >> Ritter >> Sent: Friday, February 27, 2004 1:05 PM >> To: PythonDotNet@python.org >> Subject: Re[2]: [Python.NET] Anyone or anything happening here? >> >> >> >> (whoops, sent to individual instead of mailing list first) >> >> i heard a lot of this mysterious "CPython", could anybody give me a >> hint on how to get it and check it out? google doesnt give me useful >> resuls. >> >> would be charming, if it is an x86 compiler for a typed python dialect >> :) >> >> -- Leonard Ritter >> -- paniq@gmx.net >> -- http://www.paniq.de >> -- http://www.the-mu.com >> >> Friday, February 27, 2004, 8:03:25 PM, you wrote: >> >> >> Mcic> Actually, Hawkeye (and the OP) , it's yet a bit more >> than that. I agree >> Mcic> that "it is not "Python.Net"" (it does not make Python >> run as a .NET >> Mcic> language), but it does allow you to embed Python in a >> .NET app. In fact, as >> Mcic> you're probably aware, the python.exe that you run when >> using Python for >> Mcic> .NET in the conventional way (see documented examples) >> is a simple example >> Mcic> of embedding Python in a (very small) .NET app, which >> in turn provides >> Mcic> access to a very rich interface for calling back in the >> other direction. >> >> Mcic> The viewpoint one has while using Python for .NET in >> the conventional way >> Mcic> (running the CLR-enabled python.exe, importing CLR, and >> going from there) >> Mcic> is that the CLR is acting as an appendage to Python. >> But in fact there is a >> Mcic> duality in this architecture that is subtle but >> amazingly flexible. You >> Mcic> might say that in this clever framework, Python and >> .NET are mutually >> Mcic> embedded, which offers some unique possibilities >> similar to, but even more >> Mcic> powerful than, Jython. >> >> Mcic> BTW, Jython is pretty cool too, but I prefer Python for >> .NET because it is >> Mcic> real CPython, so almost anything that you could do in >> Python before >> Mcic> integrating it with .NET, you can still do. In Jython, >> any python code has >> Mcic> to be available in source form so it can be compiled by >> Jython (at least >> Mcic> once) whereasany Python byte code that works with the >> currently supported >> Mcic> Python runtime (2.3 currently) will work with Python for .NET. >> >> Mcic> The somewhat downplayed embedding capability is the >> aspect of Python for >> Mcic> .NET that I am personally finding very useful, with the >> "calling back to >> Mcic> .NET" feature being a very nice bonus, allowing the >> embedding .NET app to >> Mcic> use Python to allow it to sort-of "script into itself". >> >> >> Mcic> P.S. -- I am not contradicting you (your answer to the >> OP is completely >> Mcic> correct) -- I'm just adding a viewpoint that I have >> found useful. >> >> Mcic> ========================== >> Mcic> Mark Barclay >> Mcic> Sr. Software Engineer, CRi Inc. >> >> >> >> Mcic> |---------+-------------------------------> >> Mcic> | | "Hawkeye Parker" | >> Mcic> | | > Mcic> | | desk.com> | >> Mcic> | | Sent by: | >> Mcic> | | pythondotnet-bounces| >> Mcic> | | @python.org | >> Mcic> | | | >> Mcic> | | | >> Mcic> | | 02/27/2004 01:05 PM | >> Mcic> | | | >> Mcic> |---------+-------------------------------> >> Mcic> >> Mcic> >> >------------------------------------------------------------- >> ------------------------------------------------------| >> Mcic> | >> Mcic> | To: , >> Mcic> >> Mcic> | cc: >> Mcic> | Subject: RE: [Python.NET] Anyone or anything >> Mcic> happening here? >> Mcic> >> Mcic> >> >------------------------------------------------------------- >> ------------------------------------------------------| >> >> >> >> >> Mcic> http://www.zope.org/Members/Brian/PythonNet/index_html >> >> Mcic> AFAIK, this is the only fully working (beta) >> implementation of anything >> Python >> .Net. take a look at the link contents for details on this >> Mcic> implementation. basically, it allows CPython access to >> .Net, but not the >> Mcic> other way around. it is not "Python.Net", but CPython >> *for* .Net . . . . >> Mcic> IMHO, it's quite good, and others on the list seem to >> like what it does/how >> Mcic> it works. >> >> >> >> >> >> >> Mcic> _________________________________________________ >> Mcic> Python.NET mailing list - PythonDotNet@python.org >> Mcic> http://mail.python.org/mailman/listinfo/pythondotnet >> >> >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet@python.org >> http://mail.python.org/mailman/listinfo/pythondotnet >>