Ever needed a python module on a system where you can only install pure python libs, for example Pythonista for IOS? This is a workaround you can use if you have a webserver (or computer reachable over the internet). You run the remfunc server part on your computer and in Pythonista you create an instance of the client and use it to send code to the server which gets executed there and the result returned. Yeah! Now you can use pandas in Pythonista!
Just a quick "pip remfunc" on the computer that´s going to be the server and on the one the that will be the client.
import remfunc
rfunc = remfunc
rfunc.start_server(host,port,debug = False)
#Set debug to True to print diagnostic stuff
#host is a string, port an int
import remfunc
rfunc = remfunc.client(host,port)
CODE has to be a string, seperate lines using \n
code = "first line of code \n"
code = code + "second line of code \n"
result = rfunc.do(code)
In case of a runtime error .do returns the error message
- You could do multiprocessing by creating multiple instances of the server using ProcessPoolExecutor, be sure to give each instance its own port though