plaintext = input(\"Please enter the text you want to compress\") filename = input(\"Please enter the desired filename\")
For Python 3.x you can convert your text to raw bytes through:
bytes("my data", "encoding")
For example:
bytes("attack at dawn", "utf-8")
The object returned will work with outfile.write.
outfile.write