First, let's talk about husbandry. In nature, after eating a snake will seek out a hiding place where it can remain warm and undisturbed for several days to several weeks, depending upon its size. If a person handles a pet snake soon after it has eaten, its instinct will be to vomit the meal because, in nature, it would need to rid itself of this bulk in order to escape. Most captive snakes, such as your python, eat rodents, rabbits or birds. These food sources possess thick layers of fur or feathers, which take time to digest.
Efficient digestion is based on the temperature at which the snake is maintained.
If your house is air-conditioned, and you simply add a basking light above the snake's cage, it is likely that the atmospheric temperature will not be high enough for the food to be properly digested, which can result in the food becoming rancid within the snake's intestines and causing it to vomit. In order to properly monitor the temperature of your snake's enclosure, you need to purchase a thermometer for placement inside the cage. One is caused by a protozoan parasite in the stomach called Cryptosporidia. Another is a viral disease that newly purchased pythons are especially susceptible to. Both these diseases, and many others, may be diagnosed and successfully treated by your veterinarian if they are detected early.