Python mendapatkan PID proses

import os
process_id = os.getpid()

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