def run(self): #Overwrite run() method, put what you want the thread do here fileDirectory = [] fileDirectory.append((self.disk, 1,0)) handle = DB.initDB(self.disk[0:1]) maxCount = self.getSubfolder(handle, fileDirectory) print maxCount DB.setFileTableCount(self.disk[0:1], maxCount) DB.closeDB(handle)