Security guard Robert Nababan encountered the snake on a palm oil plantation road in Sumatra’s Batang Gansal district on Saturday.
Mr Nababan tried to catch the python, reports say, which was 7.8m (26ft) long.
It attacked him, and man and reptile fought until Mr Nababan killed it with the help of some villagers.
The guard survived with serious injuries.
The python was not as lucky as Mr Nababan – its body was strung up for display at a village, before it was chopped up, fried and eaten.
The python was strung up on Saturday night
Mr Nababan told Indonesian news outlet Detik: “I tried to catch it, my hand was bitten, and I managed to wrestle it.”
The 37-year-old did not give an exact reason for why he tried to catch the python, but said there were villagers who could not cross the road because of the snake.
Varying reports say he was either trying to keep scared villagers safe or that he wanted to clear the road.
Local police told AFP news agency that the python had sunk its fangs into the guard’s left arm and nearly severed it.
He was taken to a hospital in Pekanbaru city, where he is still recovering, said Elinaryon, head of the Batang Gansal district government.
The official, who like many Indonesians goes by one name, told the BBC that Mr Nababan’s hand was badly injured and that doctors “might have to cut it off”.
He said giant pythons were common in his area, a remote district of Sumatra. “[There are] at least 10 sightings of them a year. In the dry season they come out looking for a drink, in the wet they come out to take a bath in the rain.”
Mr Elinaryon said it was inadvisable for people to tackle the giant reptiles. “You really shouldn’t try to do that… of course the snake, if you try and kill it, is going to get really angry and that’s when it fights back!”
He was not surprised that the python was eaten. “I have heard from friends that they are really tasty. I mean it’s a 7m snake – that’s a lot of meat!”
“The blood, some people believe, has healing qualities and can be used in medicine.”
In March another encounter with a giant snake turned out differently, when an Indonesian villager was found dead in the belly of a python.