Open jinyuwang opened 8 years ago
socket_to_futu_api = futu_comom_api.connect_to_futunn_api("localhost", 11111)
def connect_to_futunn_api(host, port): try: socket_futu_api = socket.socket(socket.AF_INET, socket.SOCK_STREAM) socket_futu_api.settimeout(2) socket_futu_api.connect((host, port)) socket_futu_api.settimeout(None) except Exception as e: print("连接错误") print(e) return return socket_futu_api
你好, 請問一开始為什么执行不了? 因為我也遇到問題
socket_to_futu_api = futu_comom_api.connect_to_futunn_api("localhost", 11111)
def connect_to_futunn_api(host, port): try: socket_futu_api = socket.socket(socket.AF_INET, socket.SOCK_STREAM) socket_futu_api.settimeout(2) socket_futu_api.connect((host, port)) socket_futu_api.settimeout(None) except Exception as e: print("连接错误") print(e) return return socket_futu_api