Sep-16-2020, 05:34 AM
The callback is called every time you hit <Return> due to the binding.
But the count isn't stored outside this function. Every time you call it, the attempt count is reset to 1 (line 16). You'd need to store the attempt count outside this function (in an enclosing class, an enclosing function, or as a global).
But the count isn't stored outside this function. Every time you call it, the attempt count is reset to 1 (line 16). You'd need to store the attempt count outside this function (in an enclosing class, an enclosing function, or as a global).