Hack Forums
[.NET] How to communicate with python script? - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] How to communicate with python script? (/showthread.php?tid=6061949)



How to communicate with python script? - SIM-2362662 - Mar 31, 2020

I need a way for my VB.net program to run and exchange data with a python script.
Im using the script to create websocket connections, but you can imagine the script as a python function doing simple addition or something

So how can I call this script and be able to exchange data?


RE: How to communicate with python script? - HFDone - Mar 31, 2020

connect via socket to ip:port and its the same send and recive
you can do it with any other programing lang


RE: How to communicate with python script? - mrknol - Mar 31, 2020

You can do what the user above me suggested. Or you could create a local file where the python could read what you want to communicate.


RE: How to communicate with python script? - SIM-2362662 - Mar 31, 2020

(Mar 31, 2020 10:45 AM)HFDone Wrote:  connect via socket to ip:port and its the same send and recive
you can do it with any other programing lang

(Mar 31, 2020 10:58 AM)mrknol Wrote:  You can do what the user above me suggested. Or you could create a local file where the python could read what you want to communicate.


Thanks, but i was hoping there is a way to fully integrate python in my app, so i dont even see the console.
Ill be using the same script of python on multiple threads, so I cant have 50 consoles running on my screen


RE: How to communicate with python script? - Charger - Mar 31, 2020

Do it as a socket or expose your server via HTTP.


RE: How to communicate with python script? - SIM-2362662 - Mar 31, 2020

(Mar 31, 2020 11:13 AM)Charger Wrote:  Do it as a socket or expose your server via HTTP.

Thanks but as I said above, that would require me to have the python console running, right?
I need a way for my vb.net app to initiate as many scripts and not have them showing on the screen


RE: How to communicate with python script? - HFDone - Mar 31, 2020

choose wich on you want to be server the other one will be client
vb and python script its easy to find


RE: How to communicate with python script? - Mysticism - Mar 31, 2020

You might also want to look into interprocess communication


RE: How to communicate with python script? - BahNahNah - Apr 1, 2020

(Mar 31, 2020 11:03 AM)♣ SoFt ♣ Wrote:  Thanks, but i was hoping there is a way to fully integrate python in my app, so i dont even see the console.
Ill be using the same script of python on multiple threads, so I cant have 50 consoles running on my screen

Have a look at IronPython.


RE: How to communicate with python script? - 0xDEAD10CC - Apr 12, 2020

(Mar 31, 2020 10:17 AM)♣ SoFt ♣ Wrote:  I need a way for my VB.net program to run and exchange data with a python script.
Im using the script to create websocket connections, but you can imagine the script as a python function doing simple addition or something

So how can I call this script and be able to exchange data?

You haven't provided much context. On the same machine or different machines? What would be wrong with Named Pipes or standard I/O? You can connect the standard I/O streams of both processes to have them interact with each other, but depending on the type of data passing between each and whether they will be running on the same machine or not would dictate a different answer.