Display issue in CAE while executing script

I have created a .py which creates 2 viewport V1 for animating odbs in sequence and V2 for displaying respective nodal graph. The script works if pasted in pyhton shell inside Abaqus. But If the exact same script is run using a *.bat or from cmd or file>run script the V1,2 displays blank screens (or the screen does not refresh not very sure) till the last odb. What is wrong?