import sys class C: def __init__(self): self.foo = 42 def method(self, x): print(self.foo) print(sys.path) C().main('spam')