Remote execution with Python 2.6 (or higher)

Last edited on


The standard Python module multiprocessing got introduced in Python 2.6 and makes creating simple client/server applications extremely easy.

Here is an example that shows how to execute arbitrary commands remotely. Because it allows executing arbitrary commands it is probably a good idea to not use it exactly like this, but rather to extend it to do only exactly what you want it to do (like kill one specific application or so).

You can download a package with the following files (and an additional file

Example - Using in Squish test scripts


function main()
    output = OS.capture('python "' + squishinfo.testCase + '/../" DIR');
    output = output.replace(/\r\n/g, "\n");
    output = output.replace(/\r/g, "\n");
    output = output.split("\n");
    for (var i = 0; i < output.length; i++) {

Example - Using without Squish


Executed in cmd.exe:

C:\Users\MyUser\Desktop> python DIR

Executing remotely: “DIR”


Related information

Please note that there are platform specific tools, like PsExec which may be an option if you can limit yourself to the platform(s) supported by them.