I am trying to align the following sequence using a python code. I am able to obtain the best score results but not the alignments with lower scores. Is there an efficient way to do this? 

    # Import pairwise2 module
    from Bio import pairwise2
    
    # Import format_alignment method
    from Bio.pairwise2 import format_alignment
    
    # Define two sequences to be aligned
    X = "ACAGCCAGCGGGGGAAATAGAGTATTTTTTTCGAGGAGGATAGGTTACTCCTCTGGTCAAAGTTGGATGCGTAATATCACACGATGCGTTGACCGCGGAGAGTGACATTATGTGGATCGGAATATCACTATTCTGCTCGAACTTCCATAG"
    Y = "ACAGCCAGCGGGGGAAATAGAGTATTTTTTTCGAGGAGGATAGGTTACTCCTCTGGTCAAAGTTGGATGCGTAATATCACACGATGCGTTGACCGCGGAGAGTGACATTATGTGAATATCACTATTCTGCTCGAACTTCCATAGAGATCG"
    
    # Get a list of the global alignments between the two sequences ACGGGT and ACG satisfying the given scoring
    # A match score is the score of identical chars, else mismatch score.
    # Same open and extend gap penalties for both sequences.
    alignments = pairwise2.align.globalms(X, Y, 1, -1, -1, -0.1, force_generic=True, score_only = True)
    
    # Use format_alignment method to format the alignments in the list
    for a in alignments:
        print(format_alignment(*a))

Here is the result I get with the above code. 

    ACAGCCAGCGGGGGAAATAGAGTATTTTTTTCGAGGAGGATAGGTTACTCCTCTGGTCAAAGTTGGATGCGTAATATCACACGATGCGTTGACCGCGGAGAGTGACATTATGTGGATCGGAATATCACTATTCTGCTCGAACTTCCATA------G
    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||      ||||||||||||||||||||||||||||||      |
    ACAGCCAGCGGGGGAAATAGAGTATTTTTTTCGAGGAGGATAGGTTACTCCTCTGGTCAAAGTTGGATGCGTAATATCACACGATGCGTTGACCGCGGAGAGTGACATTATGT------GAATATCACTATTCTGCTCGAACTTCCATAGAGATCG
      Score=141

What I want is alignments with lower scores such as 130, 100, etc. I know there could be many such examples but I need the alignments with the lower scores. I tried looking at the source code for Biopython but it seems to only give the best score. 
At the end of [**this paper**][1] there is a short program for global alignment by dynamic programming. If you know how to modify C code, it may help in your experiments.

> What I want is different scores for the same match, mismatch and gap penalties.

There is only one global alignment for the same match, mismatch and gap penalties. If you want to get multiple alignments from identical parameters, you will have to go with local alignments - and even in that case there may be only one. These algorithms are meant to go through all possible alignments, but the shortest backward path requirement means that they will output only one alignment. Look through the code I referenced above, and you may be able to modify it so it outputs a fixed number of alignments according to decreasing scores.


  [1]: https://www.nature.com/articles/nbt0704-909