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

Popular posts from this blog

How can I edit my VIM config so that Vim treats ".ejs" files the same as it currently treats my html files? -

Python __call__ special method practical example -