How to run a .py file from C#
![](https://secure.gravatar.com/avatar/ccc8dff8b8fadd57e2371f145795bda3.jpg?s=120&d=mm&r=g)
Hi, I'm a newbie in C# and python and try to run a .py file from a C# program. I tried the same thing from a C++ program using PyRun_SimpleFile and in the console, I could see the python execution (the print from python). Using Python.Runtime.dll from Python.NET, I saw that such a fonction is not available, and should use PythonEngine.ImportModule and PythonEngine.RunString or PythonEngine.RunSimpleString. The thing is that it only works for a command written over one line, but if I have a "def" (which is written over several lines), the RunString doesn't work any more... So how can I run the whole file, and not only line by line ? By the way, what does exactly the ImportModule function ? Maybe the .py file is already executed but I can't see it ? Is there a way to get the output and display it in the console ? Thanks for you answer __ Sylvie LIVERNAIS ___________ Applications Cartes à Puce EID * : +33 (0) 388 14 28 75
![](https://secure.gravatar.com/avatar/a9aa2a08831febcb01fc4a362ebed566.jpg?s=120&d=mm&r=g)
Hi, I am new to Python and am contemplating of using it to Unit Test the .NET application written in VC++. I know there is documentation of using the Python Unit Testing Framework. Is there anything else (a book or a website) that'd be helpful in walking me through the steps of being able to Unit Test the various VC++ classes and their behavior using Python ? I mean - what is the best way for me to learn how to go about writing a Python program to write Unit Test cases ? Appreciate any info I can get. Thanks --Radhika Radhika Srivatsa UMS Software Development Voice: (858)618-2235
participants (2)
-
LIVERNAIS Sylvie
-
Srivatsa, Radhika