variables - Python: Store Token in Memory -
i have class , in class have function performs authentication , returns token.
i store token in memory use other functions in same class.
how ?
presuming structure this:
class myclass(object): def doauth(self): callauthprocedure()
if callauthprocedure
returns token, adjust this:
class myclass(object): def doauth(self): self.token = callauthprocedure()
later, other methods on instance of class can use self.token
necessary.
Comments
Post a Comment