IronPython newbie: not clear on imports and assemblies

Mike Driscoll kyosohma at gmail.com
Wed Apr 15 17:00:05 EDT 2009


On Apr 15, 3:31 pm, Thomas Gagne <tga... at wide-open-west.com> wrote:
> OK--I also haven't programmed on .NET before.
>
> My goal is to play with the "EssentialPDF" libraries inside IronPython.
>   But I'm not clear on how to import (load?) Essential's .dll files.  Of
> course, all the samples files are in C# and VB.  I guess I"m wondering
> if Essential's libraries (assemblies?) should already be in my path or
> if I need to provide a path to them, and whether or not I'm going to use
> "import" or Assembly.Load(), and if the latter, where am I to find
> Assembly?  I'm pretty sure that has to be imported as well 'cause
> whenever I try to use it I'm told it doesn't exist...
>
> Anyway, I'll keep Googling around and reading tutorials to catch-up.  I
> haven't used Python since 1999 so I need some refreshing...
> --
> Visit <http://it.toolbox.com/blogs/anything-worth-doing> to read
> my rants on technology and the finance and consulting industries.

First of all, you should join the IronPython mailing list and ask
there. They can probably give quicker, better answers. See
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

You might also want to buy Michal Foord's new book: IronPython in
Action from Manning.

I'm pretty new to IronPython too, but my guess is that you'd have to
do something like this:

<code>
import clr
clr.AddReference("EssentialPDF")

# now EssentialPDF should be in your python namespace
# so you can do something like this:

from EssentialPDF import SomeModule

# or

EssentialPDF.SomeModule

</code>

At least, that's how it seems to work for most .NET libraries. Hope
that helps.

- Mike



More information about the Python-list mailing list