I want to convert a list of fasta ( protein sequences) in a .text file into corresponding nucleotide sequences. A Google search gives me result of DNA to protein conversion but not vice versa. Also, I came across How do I find the nucleotide sequence of a protein using Biopython?, but this is what I am not looking for. Is there any possible way to do it using python.Moreover, I would like to solve it using python programming. I am sure there must be some way to do it rather than writing a code from scratch. Thanks!
As lieven.sterck points out: this returns you 'a' backtranslation of a peptide sequence. You could use a more dedicated statistical model using codon frequencies from your organism under study, but this is the gist of it:

    import random
    
    AA2NA = {
        "A": list("GCT,GCC,GCA,GCG".split(",")),
        "R": list("CGT,CGC,CGA,CGG,AGA,AGG".split(",")),
        "N": list("AAT,AAC".split(",")),
        "D": list("GAT,GAC".split(",")),
        "C": list("TGT,TGC".split(",")),
        "Q": list("CAA,CAG".split(",")),
        "E": list("GAA,GAG".split(",")),
        "G": list("GGT,GGC,GGA,GGG".split(",")),
        "H": list("CAT,CAC".split(",")),
        "I": list("ATT,ATC,ATA".split(",")),
        "L": list("TTA,TTG,CTT,CTC,CTA,CTG".split(",")),
        "K": list("AAA,AAG".split(",")),
        "M": list("ATG".split(",")),
        "F": list("TTT,TTC".split(",")),
        "P": list("CCT,CCC,CCA,CCG".split(",")),
        "S": list("TCT,TCC,TCA,TCG,AGT,AGC".split(",")),
        "T": list("ACT,ACC,ACA,ACG".split(",")),
        "W": list("TGG".split(",")),
        "Y": list("TAT,TAC".split(",")),
        "V": list("GTT,GTC,GTA,GTG".split(",")),
        "*": list("TAA,TGA,TAG".split(","))
    }
    
    def aa2na(seq):
        na_seq = [random.choice(AA2NA.get(c, ["---"])) for c in seq]
        return "".join(na_seq)
    
    print("MARNDCQEGHILKMFPSTWYV*", aa2na("MARNDCQEGHILKMFPSTWYV*"))

One possible output:

    MARNDCQEGHILKMFPSTWYV* ATGGCTCGAAATGACTGCCAAGAGGGACACATTCTTAAAATGTTTCCGAGTACCTGGTACGTCTAA

Edit: changed return value of AA2NA.get() for "unknown" amino acids to "---" instead of "-".