This is how pythons climb trees

Pythons live primarily in tropical forests, savannas, and wetlands; a smaller number of species live in deserts. Pythons often settle near water—they are good swimmers and divers. Many species climb trees; there are also species that are almost entirely arboreal.