os.getpid()

Returns the process PID.

In [1]: import os

In [2]: os.getpid()
Out[2]: 18399