openfile.py is the final working code for calculating bond length