python step detection