World of Warcraft (WOW) Gnomeregan card task chain ASCII code decoding (python)

Operating environment: python 3.9

Translation result:

Coding on A Machine: Tell your friends to play WoW
Code on white card: Thrall and Jaina sitting in a tree, K-I-S-S-I-N-G
Coding after machine A: Play the Warcarft role playing game
Encoding on machine B: Gnomercy!
Code on yellow card: If you can read this, you’re standing too close
Coding after machine B: The Lich King lives!!!
Coding on a C machine: Recipe: Mechanical Chicken Soup
Code on blue punched card: The gnome king wears night elf underwear
Coding after C machine: Play More WoW
Coding on D machines: How am I driving?
Code on red punch card: Help! I’m trapped in a binary punch card factory!
Encoding after D machine is finished:
Code on color punched card: Message to Castpipe: your laundry’s ready for pickup.

Personally, the most interesting scenes are Thrall and Jaina kissing under the tree and the dwarf king wearing night elf underwear. Hahahahaha

def binaryToAscii(binary_str):
    # convert binary string to decimal number
    num = int(binary_str, 2)
    # Convert the number to the character corresponding to the ASCII code
    char = chr(num)
    return char


def get_res(dataSource):
    dataSource_sp = dataSource. split(" ")
    res = ""
    for binCode in dataSource_sp:
        res + = binaryToAscii(binCode)

    return res


if __name__ == "__main__":
    dataSources = {<!-- -->
        "Encoding on machine A":
            "01010100 01100101 01101100 01101100 00100000 01111001 01101111 01110101 01110010 00100000 01100110 " \
            "01110010 01101001 01100101 01101110 01100100 01110011 00100000 01110100 01101111 00100000 01110000 " \
            "01101100 01100001 01111001 00100000 01010111 01101111 01010111",

        "Coding on white card":
            "01010100 01101000 01110010 01100001 01101100 01101100 00100000 01100001 01101110 01100100 00100000 " \
            "01001010 01100001 01101001 01101110 01100001 00100000 01110011 01101001 01110100 01110100 01101001 " \
            "01101110 01100111 00100000 01101001 01101110 00100000 01100001 00100000 01110100 01110010 01100101 " \
            "01100101 00101100 00100000 01001011 00101101 01001001 00101101 01010011 00101101 01010011 00101101 " \
            "01001001 00101101 01001110 00101101 01000111",

        "Encoding after machine A completes":
            "01010000 01101100 01100001 01111001 00100000 01110100 01101000 01100101 00100000 01010111 01100001 01110010 "
            "01100011 01100001 01110010 01100110 01110100 00100000 01110010 01101111 01101100 01100101 00100000 01110000 "
            "01101100 01100001 01111001 01101001 01101110 01100111 00100000 01100111 01100001 01101101 01100101",

        "Encoding on machine B":
            "01000111 01101110 01101111 01101101 01100101 01110010 01100011 01111001 00100001",

        "Coding on the yellow card":
            "01001001 01100110 00100000 01111001 01101111 01110101 00100000 01100011 01100001 01101110 00100000 01110010 "
            "01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00101100 00100000 01111001 01101111 "
            "01110101 00100111 01110010 01100101 00100000 01110011 01110100 01100001 01101110 01100100 01101001 01101110 "
            "01100111 00100000 01110100 01101111 01101111 00100000 01100011 01101100 01101111 01110011 01100101",

        "Encoding after machine B completes":
            "01010100 01101000 01100101 00100000 01001100 01101001 01100011 01101000 00100000 01001011 01101001 01101110 "
            "01100111 00100000 01101100 01101001 01110110 01100101 01110011 00100001 00100001 00100001 00100001 00100001 "
            "00100001 00100001 00100001 00100001 00100001 00100001 00100001 00100001 00100001 00100001 00100001 00100001 "
            "00100001 00100001 00100001 00100001 00100001 00100001 00100001 00100001",

        "Encoding on a C machine":
            "01010010 01100101 01100011 01101001 01110000 01100101 00111010 00100000 01001101 01100101 01100011 01101000 "
            "01100001 01101110 01101001 01100011 01100001 01101100 00100000 01000011 01101000 01101001 01100011 01101011 "
            "01100101 01101110 00100000 01010011 01101111 01110101 01110000",

        "Coding on blue punched card":
            "01010100 01101000 01100101 00100000 01100111 01101110 01101111 01101101 01100101 00100000 01101011 01101001 "
            "01101110 01100111 00100000 01110111 01100101 01100001 01110010 01110011 00100000 01101110 01101001 01100111 "
            "01101000 01110100 00100000 01100101 01101100 01100110 00100000 01110101 01101110 01100100 01100101 01110010 "
            "01110111 01100101 01100001 01110010",

        "Encoding after the C machine completes":
        "01010000 01101100 01100001 01111001 00100000 01001101 01101111 01110010 01100101 00100000 01010111 01101111 "
        "01010111",

        "Encoding on the D machine":
        "01001000 01101111 01110111 00100000 01100001 01101101 00100000 01001001 00100000 01100100 01110010 01101001 "
        "01110110 01101001 01101110 01100111 00111111",

        "Coding on Red Punch Card":
        "01001000 01100101 01101100 01110000 00100001 00100000 00100000 01001001 00100111 01101101 00100000 01110100 "
        "01110010 01100001 01110000 01110000 01100101 01100100 00100000 01101001 01101110 00100000 01100001 00100000 "
        "01100010 01101001 01101110 01100001 01110010 01111001 00100000 01110000 01110101 01101110 01100011 01101000 "
        "00100000 01100011 01100001 01110010 01100100 00100000 01100110 01100001 01100011 01110100 01101111 01110010 "
        "01111001 00100001",

        "Encoding after D machine completes":
        "00111100 01101001 01101110 01110011 01100101 01110010 01110100 00100000 01100110 01110101 01101110 01101110 "
        "01111001 00100000 01101101 01100101 01110011 01110011 01100001 01100111 01100101 00100000 01101000 01100101 "
        "01110010 01100101 00111110",

        "Coding on Color Punched Cards":
        "01001101 01100101 01110011 01110011 01100001 01100111 01100101 00100000 01110100 01101111 00100000 01000011 "
        "01100001 01110011 01110100 01110000 01101001 01110000 01100101 00111010 00100000 01111001 01101111 01110101 "
        "01110010 00100000 01101100 01100001 01110101 01101110 01100100 01111001 00100111 01110011 00100000 01110010 "
        "01100101 01100001 01100100 01111001 00100000 01100110 01101111 01110010 00100000 01110000 01101001 01100011 "
        "01101011 01110101 01110000 00101110"
    }

    for key in dataSources:
        print(key + ": " + get_res(dataSources[key]))