0

How using Python I can dynamically generate my call to my xmlrpc server using xmlrpc lib? something like

def call_method(method_name)
   server = Server(self.URL, transport=ProxiedTransport())
   server.method_name(params)

The resolution takes method_name instead of for example if method_name=get_time: server.get_time(params).

themel
  • 8,825
  • 2
  • 32
  • 31
Y G
  • 68
  • 1
  • 6

1 Answers1

2

The source of xmlrpclib contains this comment, which you might find applicable outside its original context.

   # note: to call a remote object with an non-standard name, use
   # result getattr(server, "strange-python-name")(args)

It's a general Python idiom.

Community
  • 1
  • 1
themel
  • 8,825
  • 2
  • 32
  • 31