How to change Spot API URL to Spot Test Network URL with python?

Hi,

I successfully get the the test Spot API Key and Secret. According to the guidance, the next step should be to change the Spot API URL to Spot Test Network URL. But in Python ,I don’t know where to change this parameter.

I found that there are URL parameters in the init.py file, but the modification here is useless. What should I do?

def __init__(self, key=None, secret=None, **kwargs):

        if "base_url" not in kwargs:

            kwargs["base_url"] = "https://api.binance.com"

            # kwargs["base_url"] = "https://testnet.binance.vision"

        super().__init__(key, secret, **kwargs)

Thanks!

This question should be directed to the owner of the library via Github Issues.

Thanks,i will do that!

I have solved this problem.
The api-package I downloaded before is incomplete and the client file is missing. After re-downloading through the pip install python-binance command, the test environment is built with the following code:

from binance.client import Client

client = Client(api_key, api_secret)
client.API_URL = 'https://testnet.binance.vision/api'
print(client.get_account())