0

I'm trying to stream data from firebase in my GUI ( Tkinter ) app.

I tried to stream the data in console and it goes very well, but i don't understand how can I stream it into the gui app.

Near by is what I've done

import pyrebase
from firebasedata import LiveData
from tkinter import *
import firebase_admin


pyrebase_config = {
    'apiKey': "api-key",
    'authDomain': "Domm",
    'databaseURL': "url",
    'projectId': "Id",
    'storageBucket': "storage",
    'messagingSenderId': "messId",
    'appId': "appId"
}


firebase = pyrebase.initialize_app(pyrebase_config)

def stream(message):
    print(message["data"])
    print(message['path'])



users = db.child("/Inscrieri").stream(stream)
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • 1
    The simple way is to insert `message['data']` and `message['path']` into a tkinter `Text` widget. – acw1668 Jun 14 '19 at 08:48
  • I tried, but it shows that 'message' is not defined – Dan Chiriac Jun 14 '19 at 09:19
  • 1
    You can just replace the two `print(...)` in `stream(...)` function by `textbox.insert(END, message['data'])` and `textbox.insert(END, message['path'])` where `textbox` is an instance of `Text(...)`. – acw1668 Jun 14 '19 at 09:24

0 Answers0