I first converted a string of a method name, to a method with eval. Now I want to call that method on a class, but I'm having trouble.
method = eval(request.args['method'])
Communicator.method
eval(request.args['method']) returns the method, however calling this line in this class throws an error, as the method is not defined in this class. The method belongs to another class "Communicator", so I'm trying to call the method on Communicator directly.
For example would need something like Communicator.method however defining method above throws an error, and so does calling Communicator.eval(method)
Is there a "call" method that lets you call a method on a class by passing the method name into another "call" method, such as Communicator.call(post_create())?
I also noticed that Communicator.__dict__ has references to all its methods, so maybe I could call it somehow that way?
Thanks for the help!