I am using Python to retrieve data from Mongo database to analyze it. So I am changing data using meteor app and client python to retrieve it in a real time. This is my code:
from MeteorClient import MeteorClient
def call_back_meth():
print("subscribed")
client = MeteorClient('ws://localhost:3000/websocket')
client.connect()
client.subscribe('tasks', [], call_back_meth)
a=client.find('tasks')
print(a)
when I run this script, it only show me current data in 'a' and console will close,
I want to let the console stay open and print data in case of change. I have used While True to let script running and see changes but I guess it's not a good solution. Is there any another optimized solution?