1
file write problems
ThaddeasMarkle (0)

I've been working on a project that enciphers and deciphers text using the viginere cipher. My problem is with the encrypt_file() function. It reads the file fine, but at the part where it writes to the file, toencrypt.txt never changes. I downloaded the code as a .zip, and it worked as expected, so I know it's not a problem with my code. Here's a link to it though: https://repl.it/@ThaddeasMarkle/Viginere

You are viewing a single comment. View All
1
malvoliothegood (90)

Create an empty file called 'encrypted.txt' and use this code to write the encrypted text to it:

 with open('encrypted.txt', 'w') as file:
        file.write(text)