Why, in this code, can't I access db
or file
from inside do_more()
?
def do_stuff(queue):
db = getDbConn()
while True:
file = queue.get() #DirEntry object
...
do_more(otherObject)
q.task_done()
I'm aware I could pass db
and file
as arguments to do_more()
, but I feel like those variables should just be available in functions called from other functions. It works that way from main to first level functions. What am I missing here?