I have successfully called a python script from a button click in my windows form application written in c# with the following code:
private void login_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("C:\\Python27\\Scripts\\path\\file.py");
}
I would now like to pass a variable to the python script. I have tried passing it as an argument to no avail (works in php like this):
private void login_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("C:\\Python27\\Scripts\\path\\file.py myVariable");
}
I receive no errors in the visual studio compiler with this code, but when i click the button to initiate the python script I receive an error that says "Win32 exception was unhandled - The system cannot find the file specified"
I have also tried this to no avail - How do I run a Python script from C#?