Code for executing Python methods