import rpyc import os conn = rpyc.classic.connect("192.168.192.45",18812) conn.execute('import os') ros = conn.modules.os ros.system('docker restart tiny1') #ros.system('docker restart 62eab82f7759') #print('after restart') #time.sleep(11) #print('after wait')