R
R
rbild2020-05-13 12:31:36
Python
rbild, 2020-05-13 12:31:36

How can one Python script (located on a virtual machine) run another Python script (on another virtual machine)?

used by VirtualBox,OC-Linux

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Pankov, 2020-05-13
@trapwalker

If I understand you correctly, then you need to initiate the launch of a python program in another machine on the initiative of a python program in one machine.
Many ways:

  • SSH allows you to remotely run something, and python can execute a shell command with running ssh with parameters locally. This will give you the desired result. But you need to register the keys and prepare all this. Not a safe option.
  • The second program (and the remote side) can raise a web server and wait for a signal to launch some piece of code () in the form of an http request. This option is better than the first one.
  • You can raise a service with a message queue, such as RabbitMQ , on one of the listed or on a separate machine . The signal to start can be transmitted through it.

Describe why you need it and you will be prompted what is usually used for these purposes. Perhaps you didn’t come from the right side at all and you need to do it differently.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question