Python - Get the process id of an instance
<p>I'm trying to work with different processes in Python, and I am having some difficulty getting the PID of a particular instance.</p>

<p>For example, I'm sending the mainCar instance in one class:</p>

<pre><code>warehouse = Warehouse()
mainCar = Car().start()
warehouse.add(mainCar)
</code></pre>

<p>in the warehouse class, I'm reciving the mainCar variable and want to know its PID</p>

<p>How do I get the process id using the mainCar variable? I would be passing this variable to a different class and the process ID of this variable would be different to what os.getpid() give me. </p>

<p>Thanks in advance!</p>