RE: [IronPython] Executing a python source from C#

2005-04-29 Thread Keith J. Farmer
.NET Attributes have a similar calling mechanism in C#: [FooAttribute(1, 2, A=3, B=4)] To use the named parameters, I believe FooAttribute must implement A and B as properties. Since attributes are classes, one can instantiate them, and set properties at that time. Not exactly the way I th

RE: [IronPython] Executing a python source from C#

2005-04-29 Thread Ryan Davis
What I'd really like is the ability to create a .dll that we reference in other .NET apps, just as now we can write a class library in C# and use it in a VB.NET web application. I have zero clue of the complexity of that task, but that'd be my ideal. I imagine that'd be pretty hard, given the

RE: [IronPython] Executing a python source from C#

2005-04-29 Thread Keith J. Farmer
I think having a standard interface for creating consoles would be a great way to implement IronPython's console. Being able to swap in semi-arbitrary languages into FooConsole could be useful for a variety of apps. public delegate ConsoleInputHandler(string input); IConsole console = new Co

RE: [IronPython] Executing a python source from C#

2005-04-29 Thread Jim Hugunin
That will generate a SyntaxError just as if you passed a partial block to exec. If you're interested in experimenting with embeddable consoles, you should take a look at the code for IronPythonConsole which also uses PythonEngine to do its loops. Ultimately, I think that IronPython should ship

RE: [IronPython] Executing a python source from C#

2005-04-29 Thread Keith J. Farmer
What happens if we send in a partial block, as might happen when creating an embeddable console? string stmt = "for i in range(6):"; engine.Execute(stmt); Or is it expected that we ensure that such things don't happen? <>___

RE: [IronPython] Executing a python source from C#

2005-04-29 Thread Jim Hugunin
Fabien Meghazi wrote: > How can I execute some python code that I have in a String() from a C# > .NET > program or an aspx application ? > I also would like to get back the stdout that the python code produced. You want to use IronPython.Hosting.PythonEngine. Here's a simple example program. We'

[IronPython] Executing a python source from C#

2005-04-29 Thread Fabien Meghazi
Hi all, How can I execute some python code that I have in a String() from a C# .NET program or an aspx application ? I also would like to get back the stdout that the python code produced. Is it possible ? -- Fabien Meghazi http://www.amigrave.com ___