Most snakes have very poor eye sight, and can only track the presence and movement of animals by their heat and when they move. Ball pythons don't have to eat. All animals have to eat to live. Ball pythons, especially the wild caught ones, may be reluctant eaters and fast for long periods of time because they don't recognize the mice we offer them as being food. Just being alive, however, burns of calories, and if they don't eat to replenish those calories, they will die.
All lizards eat flies and other insects.
Many species of lizards are vegetarians, consuming only leaves, flowers and fruits. Some species of lizards eat primarily plant matter with a few insects, other invertebrates, or small animals now and then. Others eat primarily invertebrates or only animals, including other lizards, snakes, amphibians, fish, birds and mammals. You cannot make a carnivorous reptile into a vegetarian and you should not feed animals to vegetarian lizards. Doing either will result in serious health problems and an early death.