python 2.7 - My program jumps straight to else in a long string of if/elif/else and won't do its job -


this 1st segment of decoding script(in sense, same except 3 characters , there several hundred more) , not find proper character.

#only 1 i'll comment, same except in converted character.     if(str(fin.readline().rstrip('\n')) == "2a"):#if read string *without newlines* found on current line, convert it.         converted = "a"#decoded character.         fout.write(converted)#write memory         loop = loop - 1#decrease characters left         print str(loop) + " characters decode!"#useful information output.         time.sleep(0.1024)#slow down program!         fout.flush()#save output. 

here encoded file:

17 f4 f5 dd fc ed fe ef ff f1 f4 f3 fc f1 ed ec ff f4 

first line here number of encoded characters.

here's original...

klzsdufvhkjshdcvk 

here's else , end of while loop:

    else:         exit() fout.close() fin.close() print "exiting..." time.sleep(3.237465790263490545790869475236789568234795692348975634789695436895689763874567) print "done!!!" time.sleep(1.20745) exit() 


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -