I am trying to figure out whether a compound is a potential drug precursor using biopython. And I need to search the atoms in the compound within a certain range of a given atom in a given residue. But I don't know how to use the NeighborSearch in the Bio.PDB and after reading this website(https://www.biostars.org/p/1816/) just made me more confused....

Could anyone procide me with a specific example about how to use the NeighborSearch? Thank you very much!
Normally you should write down what have you tried so others understand the specifics of the problem. That being said, here is an concrete example for NeighborSearch. Suppose you have a PDB `1prot.pdb` in the current directory and want to find all residues at distance 5 angstroms from alpha carbon  in residue position `311` in chain `A`:

    import Bio.PDB
    
    parser = Bio.PDB.PDBParser(QUIET=True) # QUIET=True avoids comments on errors in the pdb.
    
    structures = parser.get_structure('1prot', '1prot.pdb')
    structure = structures[0] # 'structures' may contain several proteins in this case only one.
    target_atom = structure['A'][311]['CA']
    
    atoms  = Bio.PDB.Selection.unfold_entities(structure, 'A')
    ns = Bio.PDB.NeighborSearch(atoms)
    
    close_atoms = ns.search(target_atom.coord, 5)


`close_atoms` is a list containing all atoms at distance 5 from the coordinates of `target_atom`. Note that this includes `target_atom` itself. To eliminate it from the list do: `close_atoms.remove(target_atom)`.