Skip to main content
 首页 » 编程设计

python之如何在 python 3.6.2 中使用 suds.client 库

2025年02月15日9pander-it

我在 python 2.7 中运行下面的代码,它运行良好:

        from suds.client import client 
        client = Client(self.service_address) 
        rid = client.service.bpPayRequest(terminalId=self.terminalId, 
            userName=self.userName, 
            userPassword=self.userPassword, 
            orderId=order_id, 
            amount=price, 
            localDate=local_date, 
            localTime=local_time, 
            additionalData=additional_data, 
            callBackUrl=call_back_address, 
            payerId=0) 

但是当我在 python 3.6.2 中运行时,它不起作用。我猜客户端是用于 python 2 的。如何在 python 3.6.2 中使用 suds.client 库并在 python 3.6.2 中运行顶级代码?

请您参考如下方法:

尝试使用

$ pip install suds-py3 

它适用于 python 3.7。