I am reusing a piece of code from another developer (it is a socket listener) which has the following function:
def start_my_client(self, *, config: dict):
I am new to Python, so I am assuming it requires a dictionary variable to be passed as an argument, so I created this variable:
config_dic = {'name': 'my_socket', 'hostname': 'test', 'description': 'TEST'}
However, I tried many different ways to pass the variable when calling the function, but none of them worked for me, for example:
def handle_messages(conn, addr):
conn.start_my_client(config=config_dic)
I receive nothing from the function. I tried this too:
def handle_messages(conn, addr):
conn.start_my_client(**config_dic)
It throws this error:
TypeError: start_my_client() got an unexpected keyword argument 'name'
Any hint on how to pass the variable?