I am relatively new to python I would like to run a block of code only once for a class. Like the static block in java.
for eg:
class ABC:
execute this once for a class.
Is there any such options available in python?
In java we write it like this. This is executed only once for a class, at the time the class is loaded. Not for every object creation
public class StaticExample{
static {
System.out.println("This is first static block");
}
}
Thanks