I am using pybullet in a python class. I import it as import pybullet as p.
When I have several instances of the class using pybullet, is the class p the same for each instance or is the "variable" p unique for each instance?
foo.py
import pybullet as p
class Foo:
def __init__(self, counter):
physicsClient = p.connect(p.DIRECT)
def setGravity(self):
p.setGravity(0, 0, -9.81)
(more code)
and main.py
from foo import Foo
foo1 = Foo(1)
foo2 = Foo(2)
foo1.setGravity()
will setGravity() affect p in foo1 and foo2 or just foo1?
pis not a variable in the traditional sense; it's a module, so it's the same for everyFooinstance.selflike so :def setGravity(self)