from threading import Lock EXCEL_JOBS = {} EXCEL_LOCK = Lock()