Python Obtenha um pid de processo

import os
process_id = os.getpid()

# https://docs.python.org/3/library/os.html has more information
CompSciGeek