iot-nextop / A-

A팀 저장소
0 stars 0 forks source link

파이썬으로 불러오는 Firebase 소스 #12

Open CT-1326 opened 5 years ago

CT-1326 commented 5 years ago
from firebase import firebase
import datetime

firebase = firebase.FirebaseApplication('https://iot-cds.firebaseio.com/', None)
i=0

for i in range(10):
    data={
        'index' : i,
        'name' : 'test player',
        'time' : datetime.datetime.now()
    }
    firebase.post('data/log',data)
firebase.put('data','index',i)

result = list(firebase.get('data/log',None).keys())
for i in range(len(result)):
    print(firebase.get('data/log','%s/time'%(result[i])))

get, put, post