In python, I want to make a class variable static so I can to use it from a different instance. is there any solution?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t follow your question exactly, but it seems to me you’re asking how to make instance variables in Python. The answer is to set them inside a method, preferably
__init__()using theselfreference.