我已经使用 firebase python 库从 firebase 获得了这个 json 响应。一切都是通过我很难解码对字符串的 json 响应来实现的,所以我可以在 tkinter 中查看它们。任何帮助都会非常感谢。
import requests
from firebase import firebase
from Tkinter import *
firebase = firebase.FirebaseApplication('https://-----', None) #hiding the url for security
message = firebase.get('/message', None)
name = firebase.get('/name', None)
print("The message is: ",message," and it's from ",name)
master = Tk()
showmessage = message," from ", name
w = Label(master, text=showmessage)
w.pack()
mainloop()
我得到的看起来像这样
#printing
('The message is: ', '"this is my message"', " and it's from ",'from a name')
#in tkinter
{"this is my message"}{"from a name"}