我有一个在构造函数中接受参数的对象。我想知道如何从 Pyro4 提供这个。一个例子:
import Pyro4
class MyPyroThing(object):
def __init__(self, theNumber):
self.Number = theNumber
Pyro4.Daemon.serveSimple(
{
MyPyroThing(): None
},
ns=True, verbose=True)
这当然会失败,因为构造函数必须有一个参数。
当这个问题解决后,你如何调用这样的对象?
theThing = Pyro4.Proxy("PYRONAME:MyPyroThing")
编辑:
我认为这个问题写得不正确,请参阅下面的答案。