Python: read from txt file line by line, than convert and save other txt file line by line. Print works great, but can't save th
from bitcoin import * ListOfLines = open ("words.txt", "r") def createFile(): wr = open("result.txt", "w") for line in ListOfLines: wr.write(line) wr.write('\n') wr.close() def readFile(): rd = open ("result.txt", "r") out = [] # list to save lines while True: line = rd.readline() if not line : break; out.append(line.strip()) rd.close() return out def main(): createFile() outList = readFile() for line in outList: Private_Key = sha256(line) toPublic_Key = privtopub(Private_Key) Create_Adress = pubtoaddr(toPublic_Key) print("Adress="+Create_Adress) print(Private_Key) print(line.strip()) if __name__ == "__main__": main()