Can't seem to apply smooth shading

I’m new to using Python in Blender and have been trying to import a terrain from images. This has gone well so far, but when I try to apply smooth shading it doesn’t seem to show up. See the screenshot, the result of running the script.

Do you need to ‘select’ the object before smoothing?

Thanks, that seemed to work, had to look up how to correctly select the object first. Is this the best way?

    ob ='Terrain') = True = ob    

if you wanna avoid using an operator and setting an object for this beforehand, you can use:

ob ='Terrain')
for poly in
    poly.use_smooth = True

Same result.