def doWork(session, res, RefHashList):
    for equipment in res['Response']['data']['items']:
        i = equipment['itemHash']
k = equipment['characterIndex']
if i in RefHashList and k != 0:
    SendJsonViaSession(session, getCharacterIdFromIndex(res, k), i,
        equipment['quantity'])
Python Multithreading a for loop with limited Threads