如何公开PyAMF服务?

2024-06-26 13:22:09 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经创建了一个名为“timesTwo”的服务,并将文件放到了正确的目录中。但是,当我尝试从客户端代码调用它时,它告诉我该服务不存在。创建服务器端代码后,如何公开服务?我错过了什么步骤?你知道吗

服务器端代码:

from pyamf.remoting.gateway.wsgi import WSGIGateway

def timesTwo(data):
    return data * 2

services = {
    'timesTwo': timesTwo,
    # Add other exposed functions here
}

gateway = WSGIGateway(services)

我很难找到在线文档。谢谢你的帮助!你知道吗

旁注:是否有一些资源(网站,书籍,任何东西)会比上面的内容更详尽pyamf.org网站你会推荐吗?!你知道吗


Tags: 文件代码from目录客户端data网站service