
def writeCords(file_path,df):
  file=open(file_path,'w')
  atoms=df.shape[0]
  file.write(str(atoms)+'\n')
  file.write('XYZ file generated by PYTHON : coordinates in Angstrom\n')
  for i in range(atoms):
    row=df.iloc[i,:]
    line=row['atom']+'  '+ \
        str(row['x'])+'  '+ \
        str(row['y'])+'  '+ \
        str(row['z'])+'\n'
    file.write(line)
  file.write('\n')
  file.close()
   
