daily pastebin goal
45%
SHARE
TWEET

Untitled

a guest Jul 12th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import firebase_admin
  2. from firebase_admin import credentials
  3. from firebase_admin import db
  4.  
  5. cred = credentials.Certificate("2.json")
  6. firebase_admin.initialize_app(cred,{
  7.     'databaseURL':'https://new1-3b819.firebaseio.com/'
  8. })
  9.  
  10. ref = db.reference('/Producto')
  11. r1 = ref.get()
  12. for key in r1.values(): #items() or values()
  13.     for key in key.items():
  14.         print(key)
  15.    
  16. ('Cantidad', 10)
  17. ('Precio', 55)
  18. ('id', 9878)
  19. ('nombre', 'usb')
  20. ('ubicaciĆ³n', 'exe2')
  21. ('Cantidad', 2)
  22. ('Nombre', 'usb-blue')
  23. ('id', 98989)
  24. ('precio', 34)
  25. ('ubicaciĆ³n', 'exe2')
  26. [Finished in 4.3s]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top