When I run the following code it hangs indefinitely.
Plotly.io.write_image(fig, self.save_path + ‘/’ + self.save_name + ‘_Scree.jpg’)
If I wrap the write_image with a Try, it will not move off the code below to show me any errors.
plotly.io.orca.config.executable = ‘C:\inetpub\wwwroot\MProd360\Python\orca\orca.exe’
Note: orca.exe is launched fine.
All other code before the write_Image executes fine.
Background: I am calling the python code from an asp.net application.
I have run the write_image code from two other personal web servers without hanging.
I moved the code to a server hosted on a Go Daddy dedicated server and I then get the hanging behavior.
Also, If I run the code purely within a Python project in Visual Studio on the Go Daddy server it runs without hangings as well.
public string run_Python(string sCMD, string sAgs1, string sArgs2)
{
string result = “”;
ProcessStartInfo start = new ProcessStartInfo();
start.FileName = "C:\\Program Files\\Python37\\python.exe";
start.Arguments = sCMD + " " + sAgs1 + " " + sArgs2;
start.UseShellExecute = false;// Do not use OS sarg2
start.CreateNoWindow = true; // We don't need new window
start.RedirectStandardOutput = true;// Any output, generated by application will be redirected back
start.RedirectStandardError = true; // Any error in standard output will be redirected back (for example exceptions)
using (Process process = Process.Start(start))
{
using (StreamReader reader = process.StandardOutput)
{
string stderr = process.StandardError.ReadToEnd(); // Here are the exceptions from our Python script
if (stderr != "")
{
result = stderr;
}
else
{
result = reader.ReadToEnd(); // Here is the result of StdOut(for example: print "test")
}
Debug.WriteLine("*****************************************************");
Debug.WriteLine("*****************************************************");
Debug.WriteLine(result);
Debug.WriteLine("*****************************************************");
Debug.WriteLine("*****************************************************");
return result;
}
}
}