I have two computers on a network. I’ll call the computer I’m working on computer A and the remote computer B. My goal is to send a command to B, gather some information, transfer this information to computer A and use this in some meaningfull way. My current method follows:
-
Establish a connection to B with paramiko.
-
Use paramiko to execute a remote command e.g.
paramiko.exec_command('python file.py'). -
Write the information to a file with pickle, and use
paramiko.ftpto transfer the file to computer A. -
Open this file and parse the information back into a usable form, like a class or dictionary.
This seems very ad-hoc. My question is, is there a better way to transfer data between computers using Python? I know how to transfer files, this is a different question. I want to make an object on B and use it on A.
I would recommend taking a look at twisted. It’s the best python framework I’ve encountered for custom client/server applications like the one you describe.