Using Python to create a sphere and map a texture onto it
You should follow some beginner tutorials first, like Blender manual, to have an idea how to find yourself around Blender's API.

To get some feedback on comman tasks just pull down Info Panel or change the layout to Scripting like:


Now you will have feedback for all actions you perform like you usually would: