Guest User

Untitled

a guest
Feb 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. def get_db():
  2. db = getattr(get_db, 'db', db_connection())
  3. get_db.db = db
  4. return db
  5.  
  6. def func1():
  7. db = get_db()
  8. db.execute('SELECT * FROM things')
  9.  
  10. def func2():
  11. db = get_db()
  12. db.execute('SELECT * FROM other_things')
Add Comment
Please, Sign In to add comment