Slide wrote:
> I am currently adding a scripting console to one of the applications I
> develop. I would like to, at runtime, add functions that can be called
> by the python code in the console. Something like
>
> // c#
> public int AddIt(int a, int b)
> {
>     return a + b;
> }
>

Does C# allow you to define functions outside of objects ? I didn't
think so...

You can create static methods on objects though.

> then, I would like to add that function (and possibly functions from
> plugins) so they can be called from python. Do I need to create a
> module and add the functions to the module? Is there a better way?
>

For an example of creating a dll from C#, and then accessing from
IronPython, see :

http://www.voidspace.org.uk/python/weblog/arch_d7_2006_07_29.shtml#e406

All the best,

Fuzzyman
http://www.voidspace.org.uk/python/index.shtml

> Thanks,
>
> slide
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to