Hi Jill.
Have a look at the documentation where it describes using 'Assembly.LoadWithPartialName'. I think you need to do something like this:
from CLR.System.Reflection import Assembly
Assembly.LoadWithPartialName("MyColleaguesFile")
from CLR.MyColleaguesFile import MyColleaguesForm
Then you can use the class natively. The above assumes that the assembly can be located in the existing path (e.g. current working directory). If not, add its location to sys.path.
Also assumed is that the namespace for the class is the same as the assembly file name. If not, use the correct one in the third line above, e.g. CLR.MyColleaguesNamespace.
Mike
---------------------------------
From: pythondotnet-bounces(a)python.org [mailto:pythondotnet-bounces@python.org] On Behalf Of Jill-Connie Lorentsen
Sent: 11 March 2004 04:16
To: pythondotnet(a)python.org
Subject: [Python.NET] Showing modal ..NET dialogs from Python
I am new to this, so please excuse me if I'm not making myself 100% clear.
My colleague is writing a modal dialog using ..NET. I want to show it from Python, but I can't figure out how.
I guess it'll be something like:
import CLR
import CLR.System.Windows.Forms as MyForm
from MyColleaguesFile import MyColleaguesForm
MyForm = MyColleaguesForm
MyForm.Show()
I've looked at the helloform, splitter and wordwin examples, the mailinglist archive etc, but I feel like I'm missing something. Is it even possible to do what I want to do?
Thanks!
Jill
---------------------------------
Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now
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(a)python.org
> [mailto:pythondotnet-bounces@python.org]On Behalf Of Leonard :paniq:
> Ritter
> Sent: Friday, February 27, 2004 1:05 PM
> To: PythonDotNet(a)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(a)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> | | <hawkeye.parker@auto|
> 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: <srussell(a)lotmate.com>,
> Mcic> <pythondotnet(a)python.org>
> 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(a)python.org
> Mcic> http://mail.python.org/mailman/listinfo/pythondotnet
>
>
>
> _________________________________________________
> Python.NET mailing list - PythonDotNet(a)python.org
> http://mail.python.org/mailman/listinfo/pythondotnet
>