[IronPython] Newbie question: can I build .NET assemblies from Python code?
jvm_cop at spamcop.net
Sat Jan 14 17:07:37 PST 2006
I think it's very likely that the Python RADIUS implementation you found is really a Python wrapper for a RADIUS C library. That is, someone wrote a "Python extension" in C, and wrote some Python code that talks to it. IronPython does not now support C extensions written for non-.Net versions of Python (and the technical problems probably mean it never will).
Actually, I just took a look and the RADIUS library is _not_ C-based. However, it relies on at least one Python standard library that is not yet implemented in IronPython. So you're in the same situation -- the RADIUS library will work not work with IronPython "as is.
The Python RADIUS implementation is no doubt usable from within "normal" (not .Net) Python. It is not difficult to write COM server apps in Python; the Python library that helps you do that (called win32com) is part of the standard Python distribution. If you go here
there's an introduction to what you need to do to write a COM server in Python; your C# code should be able to work with it easily, particularly as you'll be able to design the COM side to match what the C# side needs done If you need help for doing that, this is not the right place (but I could perhaps help you off-list).
At 01:00 AM 1/14/2006, Devin Ganger wrote
>I'm new to C# and don't have a lot of experience with advanced Python,
>so pardon this if it seems to be an obvious question.
>I have a C# project I'm working on for personal use that requires a
>functional RADIUS client library. I've searched high and low and have
>only found a single commercial library available. However, I did find a
>freely available Python RADIUS implementation, so when I ran across
>IronPython I immediately wondered if I'd be able to take the Python
>library and produce a stand-alone .NET assembly that I could then drop
>into another project.
>Is this possible, or would I need to incorproate IronPython and the
>Python RADIUS library into my C# project source code? If it is possible,
>how feasible would it be until I can get my coding skills to the point
>of writing a native C# implementation? Since it's all IL, would there be
>any drawbacks to using such an assembly?
>Thanks in advance! I very much look forward to playing with IronPython
>and learning more.
>Devin L. Ganger Email: deving at 3sharp.com
>3Sharp LLC Phone: 425.882.1032 x 109
>15311 NE 90th Street Cell: 425.239.2575
>Redmond, WA 98052 Fax: 425.702.8455
>(e)Mail Insecurity: http://blogs.3sharp.com/blog/deving/
J. Merrill / Analytical Software Corp
More information about the users