I want to write a simplest program that gives me an opportunity to use sockets and serialization.
The basic idea is to transfer data to server side with the function name and data to process. And after that deserialize this data sent on server side, to call function and perform something. Then send back the response.
Right now data that is sent to server - func name that I need to call, data that I need to process with using that func.
Im using pickle.loads to unpack data and now I have a func name as a str and dictionary to process. If I will hardcode it - it will work.
The func name that I need to call - func. But I want be able to cal any func that will be sent from client side.
I understand that I need to use getattr to be able to do that. But how? I have read couple of questions here and on other websites but still can't figure out what do I need to do.