Created
June 25, 2019 09:21
-
-
Save frieadgood/e6c56184fff7d19d8874b6ded6019f4e to your computer and use it in GitHub Desktop.
Fugle realtime API demo code(#2884)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import websocket | |
def on_message(ws, message): | |
print(message) | |
def on_error(ws, error): | |
print(error) | |
def on_close(ws): | |
print("### closed ###") | |
if __name__ == "__main__": | |
websocket.enableTrace(False) | |
ws = websocket.WebSocketApp("wss://api.fugle.tw/realtime/v0/intraday/quote?symbolId=2884&apiToken=demo", | |
on_message = on_message, | |
on_error = on_error, | |
on_close = on_close) | |
ws.run_forever() |
I have error in " websocket.enableTrace(False)"
AttributeError: module 'websocket' has no attribute 'enableTrace'.
You can install the WebSocket package from websocket_client and try again, thx!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have error in " websocket.enableTrace(False)"
AttributeError: module 'websocket' has no attribute 'enableTrace'.