#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Sep 9 16:48:16 2018 @author: taylor@mst.edu """ string = [] for i in range(256): string.append(str(i)) string.append(" is ") string.append(chr(i)) string.append("||") out = "".join(string) with open("workfile.txt", "w") as f: f.write(out) # This leaves an '\r' with open("workfile.txt", "r", newline="") as fin: read_data = fin.read() # Check for what's different for pre, post in zip(out, read_data): if pre != post: print(ord(pre), " is not ", ord(post)) print(set(out) - set(read_data))