Selection.write() — write selection coordinates to a file

write(file, model_format='PDB', no_ter=False, extra_data='')
This command writes the coordinates of all atoms in the selection to a file in the selected format.

See Model.write() for full details; note that only 'PDB' and 'MMCIF' outputs are supported with this command.