I have a GetList.py
file which consumes Web Service and saves the output in XML on the server.
How do I invoke GetList.py
so it saves the output in XML on the server before displaying the XML output in .ASPX
page?
Dotnet 4.0 supports dynamic language interaction along with static languages for which CLR extends support. Currently supported languages are Ruby and Python.
Python.NET is a package that gives Python programmers nearly seamless integration with the . NET 4.0+ Common Language Runtime (CLR) on Windows and Mono runtime on Linux and OSX. Python for . NET provides a powerful application scripting tool for .
To run Python scripts with the python command, you need to open a command-line and type in the word python , or python3 if you have both versions, followed by the path to your script, just like this: $ python3 hello.py Hello World! If everything works okay, after you press Enter , you'll see the phrase Hello World!
You can create one batch file which contains call to python file and call that batch file from you .net application. To call batch file, you can use Process class. For example, suppose you have test.py file containing following code :
print "hello world"
then create one batch file (file having .bat extension) which has following contents :
python C:\test.py
Assuming you are using C#, and ur batchfile is stored in (C:\test.bat) you can use following code to invoke batch file
Process.Start("C:\test.bat");
You can have more details about Process class here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With