views:

117

answers:

1

Now the obvious answer is to just open the script from a command line, but that isn't an option. I'm writing a simple application to syntax highlight Python and then run the scripts from the same program. A Python IDE if you will. The scripts I want to run are entirely command line programs.

I'm using a System.Diagnostics.Process object. I can either use it to run a command line prompt or to run the Python script, but the command line window will close as soon as the script errors or finishes. I need to keep it open. The ideal solution would be to open the command line and run the Python script from the command line, but I need to do it in one click from inside a .Net application.

Any ideas? Is there a better way to keep the console open?

+1  A: 

Don't use a Windows console. Create your own console panel or window which attaches to the stdin, stdout, and stderr of the interpreter executable. Or embed your own interpreter.

Ignacio Vazquez-Abrams