Changing the Texture Map on a Sphere using Python Scripting

I am attempting to write a simple Python Script that genereates a source sphere (which I have had no problems doing) and then adding and changing the textures on the sphere for example, in the simplest case I would like my script to generate the sphere, place a texture (call it texture A) on it, render the sphere in the window with texture A, then change the texture to a different one (call it texture B), and render this sphere with the new texture in the window. I would like these to alternate at a rate so that I can clearly see the textures changing. It is worth noting that the script I have runs, but while running ParaView becomes unresponsive.

This is what I have regarding changing the texture:


while count<=30:
if count%2==0:

Where fish is just the variable assigned to CreateTexture.

The script does produce an output but it seems that it will only ever show the final Render() call in the window. Any help is appreciated.