Packaging script source files in IronPython and IronRuby

Does anyone know how to add python and ruby ​​libs as a resource in a dll for deployment? I want to host a script engine in my application, but I do not want to deploy all the standard libraries of the corresponding languages ​​in the source files. Is there an easy way to do this so that an import or import request finds embedded resources?

+3
source share
3 answers

You can add a custom import hook that searches for embedded resources when importing. This is a bit complicated and probably not worth the trouble.

, ScriptEngine sys.modules, . Python, .

+1

StreamContentProviders,

ironrubymvc IronRubyMVC/Core/ , .

AssemblyStreamContentProvider

ContentProvider

0

IronPython 2.0 has a sample compiler called PYC on Codeplex.com/ironpython that can create DLLs (and applications if you need them).

IronPython 2.6 has a newer version of PYC in the Tools \ script menu.

Cheers, Davy

0
source

Source: https://habr.com/ru/post/1709500/


All Articles