У меня есть один с мультипроцессором и подпроцессом, который я не тестировал, но должен работать на основе документов ...
Сервер:
import subprocess
from multiprocessing.managers import BaseManager
def get_subprocess_module():
return subprocess
class MyManager(BaseManager):
pass
MyManager.register( 'subprocess', get_subprocess_module )
MyManager(address=('', 50000), authkey='makecrazy').get_server().serve_forever()
Удаленный клиент:
from multiprocessing.managers import BaseManager
class MyManager(BaseManager):
pass
MyManager.register('subprocess')
manager = MyManager(address=('dns.of.remote.server',50000),authkey='makecrazy')
manager.connect()
remoteSubprocess = manager.subprocess()
rc = remoteSubprocess.call(['ls', '-aplh'])