Found the problem !
I ran the python script in idle3 and waited and waited for it to fail.
It turns out that the failure was due to a network failure in an other Pi
and nothing to do with the webserver !
The script uses pigpio to access the state of a relay in the other Pi .. which is controlling the central heating boiler.
This controller Pi's networking has failed and hence the failure.
So ... on to that problem!
With regard to my original question adding lots of logs and running the script in idle3 helped solve the problem.
Most effective I think was running it in idle3 to get its error messages
Regards