How to write an entire trajectory into a single PDB file? I have a trajectory (few frames) that I want to stack together and build a single PDB. I thought either to use VMD or MDAnalysis library. 

With VMD if I do atomselect it takes a frame identifier as an argument. With MDAnalysis I saw this:

with MDAnalysis.Writer("all.pdb", multiframe=True) as pdb:
    for ts in u.trajectory:
        pdb.write(u)


However, I am not sure how to use it in a complete script.
#!/usr/bin/env python2

import MDAnalysis

# file formats are automatically deduced; this is a standard topology and binary
# (NetCDF) trajectory from AMBER
topology = 'peptide_1.prmtop'
trajectory = '02_peptide_1_equil_NVT.nc'
u = MDAnalysis.Universe(topology, trajectory)

with MDAnalysis.Writer("all.pdb", multiframe=True) as pdb:
    for ts in u.trajectory:
        pdb.write(u)


One thing that may be important: I see lots of warnings when trying to use Python 3, so 2.7 is probably better at this point.