A Python tool that decodes secret messages from table-formatted documents containing coordinates and characters.
This program reads a .docx file with a table containing x-coordinates, characters, and y-coordinates, then arranges them into a grid to reveal a hidden message.
decoder.py- Main decoding scriptexample_table.docx- Sample input document with 356 coordinate entriesdecoded_message.txt- Example output file
Install the required dependency:
pip install python-docxRun the decoder:
python decoder.pyOr use it in your own code:
from decoder import decode_secret_message
decode_secret_message("example_table.docx", "decoded_message.txt")Your .docx file should contain a table with three columns:
| x-coordinate | Character | y-coordinate |
|---|---|---|
| 48 | ░ | 3 |
| 42 | █ | 6 |
| 55 | █ | 0 |
The decoder supports any Unicode characters and arbitrary grid sizes.
Given the table in example_table.docx, the decoder outputs:
████████░ ███████░ ████████░ ████████░ ██████░ ██░ ██░ ██░ ██░
██░ ██░ ███░ ██░ ███░ ███░ ██░ ██░ ██░ ████░ ████░ ██░ ██░
██░ ██░ ███░ ██░ ██░ ██░ ██░ ██░ ██░██░ ██░██░ ██░ ██░
██░ ██░ ██░ ██░ ██░ ████████░ ██░ ███░ ██░██░ ██░ ██████████░
██░ ██░ ███░ ██░ ██░ ██░ ██░ ██░ ██░ █████░ ███░ ██░ ██░
██░ ██░ ███░ ██░ ███░ ███░ ██░ ██░ ██░ ███░ ███░ ██░ ██░ ██░
████████░ ███████░ ████████░ ████████░ ██████░ ██░ ███░ ██░ ██░
The decoded message is printed to the console and saved to the specified output file.
- Python 3.6+
- python-docx