Dec-29-2016, 03:29 PM
It looks like you have the decompression fine. The file writes correctly when I run it, although note that you need parents after file.close to actually call the close method.
Since you are importing csv, you might as well use csv.writer to write the file. Then you would use csv.reader to read the file. You can read each row as a list. They will be lists of strings, so you will need to use int to convert the indexes back to integers to reconstruct the sentence. Check out the csv documentation (https://docs.python.org/3/library/csv.html) and see if you can get it to work with that.
Since you are importing csv, you might as well use csv.writer to write the file. Then you would use csv.reader to read the file. You can read each row as a list. They will be lists of strings, so you will need to use int to convert the indexes back to integers to reconstruct the sentence. Check out the csv documentation (https://docs.python.org/3/library/csv.html) and see if you can get it to work with that.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures