Python walk of direction grid