How to change the model via python in blender?
You will have to run that python code within blender's text editor.

Possible duplicate of https://stackoverflow.com/questions/11604548/running-python-script-in-blender