1

I have a data analysis tool that I wrote in Python. I want to be able to schedule this tool to be run as new data comes in, which I can do in Visual Basic.Net. What I want to do is have a VB process spawn the python process and then send the data it receives from the python off to be reported, but I haven't been able to find much online for this kind of scenario. What tools should I be using here to make this happen?

Edit: What I ended up doing was using .Nets's System.Diagnostic.Process class to start the Python process, and then simply read off of the standard output stream. This site explained how to do this on the VB side.

  • Why don't you use the `subprocess` module? – juanpa.arrivillaga Jan 05 '18 at 16:43
  • @juanpa.arrivillaga It is already tagged with subprocess and he spawns a python from VB. can you return more information that a returncode to the process that spawned the python processing by it (never used it so far)? Or do you mean spawning the VB from python when done processing? – Patrick Artner Jan 05 '18 at 16:45
  • I meant use the Python `subprocess` module to do the spawning, which provides IPC out of the box. – juanpa.arrivillaga Jan 05 '18 at 16:48
  • As far as I can tell, the subprocess module does the opposite of what I want. I don't need to spawn another process from the Python code. – DragonSheep Jan 08 '18 at 20:15

1 Answers1

2

You could go for a file based approch:

  • vb tells python about the file to create as well as the data and waits till processing is done, reads the file in again

  • You could use a shared database

Or interprocess communication:

A good starting point would be the python documentation on interprocess communication

Patrick Artner
  • 50,409
  • 9
  • 43
  • 69