First of all, you can execute any external application using one of
System.Diagnostics.Process.Start
methods:
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx[
^].
Pay attention that you can redirect output of your external process (a compiler, C++ or Python code, compiled application, etc.) to some stream and use it in your parent process. To do so, you will need to redirect
StandardOutput
and
StandardError
. Please see:
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.standardoutput.aspx[
^],
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.standarderror.aspx[
^].
Both MSDN help article referenced above contain some redirection code samples.
If you really mean not C++, but C++/CLI, you can dynamically compile and load the .NET assembly in your host application. This is a pretty complex problem if you need to make such code reloadable, because there is no way to unload an assembly, you you would need to create and unload separate Application Domains and worth through the Application Domain boundary with IPC. You can find further detail in my past answers:
Create WPF Application that uses Reloadable Plugins...[
^],
AppDomain refuses to load an assembly[
^],
code generating using CodeDom[
^],
Create WPF Application that uses Reloadable Plugins...[
^],
Dynamically Load User Controls[
^],
C# Reflection InvokeMember on existing instance[
^].
As to the Python, you also can think about using Python for .NET. Such thing does exist, called IronPython:
http://en.wikipedia.org/wiki/IronPython[
^],
http://ironpython.net/[
^].
All the options I mentioned may or may not be applicable. I don't know you goals, that's why. Next time, please start asking your question with explanation of your ultimate goals.
—SA