<div dir="ltr">You can read all yours file scripts, then using StringBuilder to combine then and call <span class="Apple-style-span" style="font-family: Verdana; ">CreateScriptSourceFromString()</span><div><span class="Apple-style-span" style="font-family: Verdana; ">Then you can call your functions within the combined scripts normally. Pretty much you are creating a giant source code on the fly.</span></div>
<div><br><div class="gmail_quote">On Thu, Jun 11, 2009 at 5:32 PM, Patrick van der Willik <span dir="ltr"><<a href="mailto:firstname.lastname@example.org">email@example.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Verdana">I'm currently attempting to embed
the IronPython 2 runtimes into an existing application written in C#.
However, I find the amount of documentation lacking on what I'm trying
to do. I currently have a proof-of-concept version which uses Lua and
LuaInterface, but the people who have to write the scripts dislike
Lua(Well, more hate it with a passion)
and would love to see this working with Python.<br>
My host application is a networked application that must trigger
certain scripts functions on events generated by the connected clients.
The idea is that when my application starts, it will load the
IronPython script environment, launches an 'autoexec.py' which will
load various other scripts files and do some housekeeping. Once this
all is completed, it will start listening to incoming connections.
However, in various scenarios, the application has to trigger scripted
functions when data is received from a client. Which script function is
called is different per client and per event. I have events for
connecting, logging on, disconnecting and a set of data specific
events after receiving data. This highly depends on the received
My question here is: How do I embed IronPython in such a fashion that I
can load my scripts and then trigger various functions within that?
I've seen many examples that just call CreateScriptSourceFromString()
or File each time in which just 1 piece of code is implemented. This is
not suitable for the needs here because the scripted systems can become
quite complex. <br>
Users mailing list<br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><a href="http://nomadlife.org">nomadlife.org</a><br><br>