I'm trying to remote into an interactive shell and import modules within python 2.7. I'm getting hung up. So far this is what I've got:
import rpyc
import socket
hostname = socket.gethostname()
port = 12345
connections = rpyc.connect(hostname,port)
session = connections.root.getSession()
session exists
>>>session
<blah object at 0xMore-Goop>
I want to issue an import sys
so I can add another module to the path. However when I try to see if modules exist in the path I get the following:
>>>connections.modules
AttributeError: 'Connection' object has no attribute 'modules'
What I need to execute remotely is the following:
import sys
sys.path.append(path/to/import)
import file
log = file.logger(session, path/to/log)
Is it possible to have rpyc issue the above content? Thanks in advance