I used Zig for my programming language, which has a convenient function called @embedFile
that will put the file into the exe.
For python though, I have no idea how one could do that. There might be some way to create a virtual file system, but my knowledge ends there.