How do I pass a c# variable to a python script from windows form application
pI have successfully called a python script from a button click in my
windows form application written in c# with the following code:/p
precodeprivate void login_Click(object sender, EventArgs e) {
System.Diagnostics.Process.Start(C:\\Python27\\Scripts\\path\\file.py); }
/code/pre pI 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):/p precode private void login_Click(object sender, EventArgs e) {
System.Diagnostics.Process.Start(C:\\Python27\\Scripts\\path\\file.py
myVariable); } /code/pre pI 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/p pI have also tried this to no
avail - a
href=http://stackoverflow.com/questions/11779143/run-a-python-script-from-c-sharprun
a python script from c#/a/p
No comments:
Post a Comment