.net - How to create an Application Programming Interface (API) between VB.Net and Python? -
i have gui in vb.net needs interface algorithms written in python, run on windows 10 professional. ide visual studio 2017.
how can vb.net gui , python communicate? data needs communicated , forth. gui accept user commands, , command python execute. python have events needs communicate gui.
to clarify architecture, gui app , python app 2 different programs running simultaneously.
the gui has 2 major functions: 1) take user commands , tell python execute them. 2) monitor/poll python app data or events, , update (tell) user via gui controls (textboxes, etc.).
python 2 things: 1) runs continuous control algorithm, subject management gui. 2) reports data , events gui.
a tcp socket 100% reliable, have write , debug proprietary messaging scheme, i've done lot , it's fun, thought maybe can accomplish same thing in substantially less time other equally reliable method... such com, below suggest.
example scenario of asynchronous usage:
1:
the python app running robotic process. meanwhile, user presses gui command see latest metrics: gui's vb.net calls com function within python returns array of metrics data.
2:
python app running robotic process completes step, , needs manual action. python app calls com function within vb.net , passes argument requirements of manual action.
msdn python script integration
here suggest can read it's guide on msdn communicating c# pyhton
basically calling python script , reading output.
https://code.msdn.microsoft.com/windowsdesktop/c-and-python-interprocess-171378ee
ironpython
ironpython open-source implementation of python programming language tightly integrated .net framework. ironpython can use .net framework , python libraries, , other .net languages can use python code easily.
python .net
python .net (pythonnet) package gives python programmers seamless integration .net 4.0+ common language runtime (clr) on windows , mono runtime on linux , osx.
however 1 limits version of python.
other solutions
- using socket client (python) server (c#) or vice versa.
- using local database or database file mdf.
Comments
Post a Comment