Hello, a bit new to python here and would appreciate some help.
I am writing a simple encoder to a raw_input(turn to numerical ascii and then applying some numbers to it). I was able to get the encoding right but when i try to do a outfile only the first number is outputted.
What i have is this:
def encode(): mess = raw_input ("Enter message:") for i in mess: nummess = ord (i) * 2 * 7 + 3 stringnum = str(nummess) joinnum = stringnum + "," outfile = open ("encodemess.txt", "w") outfile.write (joinnum) outfile.close()
My goal is to have somthing like this show up in the .txt;
"hello" would be:
1459, 1417, 1515, 1515, 1557,
but atm, only "1459," its outputted to the .txt.
I am quite sure it is something simple, just cant put my finger on.