The ball python was probably uncomfortable to start, and struck at the chihuahua as a warm thing moving by when it was already nervous.
Maybe keep handling sessions a little shorter, and ensure the snake is not out in a room with the chihuahua in it. It is unlikely that the snake will cause much harm to the chihuahua, but the chihuahua can seriously harm the snake.
-Jen