@JonB
My file wasn’t in my scripts folder as I had thought after running your print(os.getcwd()) script. Have now managed to move the file, not obvious on the iPad, and all now works. I have been struggling with this problem for days. Thank you so much for your help.

Bill