Do you really need a process id? Then the answer is:
>>> import os >>> os.getpid() 5328
on Windows or Unix ( os.getpid documentation ).
os.geteuid() doesn't get the process id, which makes me wonder if you really ask another question ...?
source share