Python Binance, user streams/socket, need simple how to

Hi,
since three days I try to get how to use:
Python-Binance “user_socket()”.

My appreciation so far:

  • start a user_stream-thread
  • make a order, balance is changing
  • user_stream output listen to that stream und output a message

My code so far:

from binance.client import Client
from binance.websockets import BinanceSocketManager
from time import sleep

api_key = '123key'
api_secret = '123secret'
client = Client(api_key, api_secret)
client.API_URL = 'https://testnet.binance.vision/api'

def user_ticker(msg): # this websocket has no output!
    print("Trade, user-ticker():", msg)

bsm = BinanceSocketManager(client)
conn_key2 = bsm.start_user_socket(user_ticker)
bsm.start()

sleep(5) # until thread started
print("PAUSE")

# After this order "user_ticker()" should give me an output..
result=client.create_order
    (
    symbol='BTCUSDT',
    side='BUY',
    type='MARKET',
    quoteOrderQty=10.0,
    recvWindow=10000
    )
print('Create Order:', result)

I would be very very happy for a very simple example.
(my other usual websockets run well).

just open account, generate api keys, use it in your code and check result

removed

what’s the question?

API-key and -secret already insert. My other tickers run well.
The question and problem is: order-result returns a proper message, but user_ticker-thread returns nothing. I suggest that after changing the balance (e.g. after an order), the user_ticker() should output a message.
Since (now) four days I try to get out how that user data-thing works. There is no good doc with an example. The best I have found: Python Binance Doc

PS: Does user data work on testnet?

Not working very well with spot testnet on this SDK

ok, i have some questions:

  1. Is my approach/code of my first post ok?

  2. Do my approach work on the productive-platform?

  3. Doesn’t the Python-Binance-lib work well on testnet? Does it work well on the productive-plattform?