MySQL Connector/Python Developer Guide
Syntax:
thread_id = ccnx.thread_id()
Returns the current thread or connection ID.