4

I am making an ASP.NET website in which I would like to use some python 3.x code. Not exactly 'some', but a lot.

I have started searching for a solution but not exactly reached a good one yet. I am using VS 2015, and most of the solutions I found were for VS 2010, 2012. But not for VS 2015.

So I began with installing the PTVS, but that ends up in an error. Screenshot of error.

Please help regarding the installation error and how to set up the integration.

Thanks a bunch.

2

1 Answer 1

1

If you don't need exactly python 3 - take a look at IronPython (latest version is 2.7 compatible). For example: Running IronPython Scripts from a C# 4.0 Program.
If you just need to use Python script from your your .NET project - you can just ask python.exe to run the script. Something like this:

ProcessStartInfo p = new ProcessStartInfo();
p.FileName = @"\Path\to\python\interpreter\python.exe";
p.Arguments = @"\Path\to\*.py";
p.CreateNoWindow = false;
p.UseShellExecute = true;
Process procScriptExecutor = Process.Start(p);
procScriptExecutor.WaitForExit();
procScriptExecutor.Close();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.