, "" vatiable pth, . ?
import os, platform
class A(object):
@staticmethod
def getRoot():
return 'C:\\' if platform.system() == 'Windows' else '/'
A.pth = os.path.join(A.getRoot(), 'some', 'path')
:
import os, platform
class A(object):
@staticmethod
def getRoot():
return 'C:\\' if platform.system() == 'Windows' else '/'
pth = os.path.join(getRoot.__func__(), 'some', 'path')
... ( @staticmethod, ).
- ( , ):
import os, platform
class A(object):
_root = 'C:\\' if platform.system() == 'Windows' else '/'
@staticmethod
def getRoot():
return A._root
pth = os.path.join(_root, 'some', 'path')
... , , ?:) - , , .