def write_pdb(outfile, title, atoms, box):
<EOL>print('<STR_LIT>' + title, file=outfile)<EOL>print(pdbBoxString(box), file=outfile)<EOL>for idx, atname, resname, resid, x, y, z in atoms:<EOL><INDENT>print(pdbline % (idx % <NUM_LIT>, atname[:<NUM_LIT:4>], resname[:<NUM_LIT:3>], "<STR_LIT>",<EOL>resid % <NUM_LIT>, '<STR_LIT>', <NUM_LIT:10>*x, <NUM_LIT:10>*y, <NUM_LIT:10>*z, <NUM_LIT:0>, <NUM_LIT:0>, '<STR_LIT>'),<EOL>file=outfile)<EOL><DEDENT>
Write a PDB file.

Parameters
----------
outfile
    The stream to write in.
title
    The title of the GRO file. Must be a single line.
atoms
    An instance of Structure containing the atoms to write.
box
    The periodic box as a 3x3 matrix.