I'm having issues printing to a txt file. The file contains information stored in bytes. No matter what I try, I can only get the output to print in the shell. Here's what I have - any help is welcome.
def main():
with open("in.txt", "rb") as f:
byte = f.read(1)
while byte != "":
print ord(byte),
byte = f.read(1)
with open('out.txt','w') as f:
if __name__ == '__main__':
f.write(main())
close.f()
mainfunction has no return value