Can someone help me with some simple python code?
I am trying to use a python script to read from a file with hex keys and outputting the binary keys to another file.
Trying to get this working, I have messedup my original code that does not work now.
Here is the code I was using to convert hex to binary one at a time:
print"====================================================="
print" HEXADECIMAL TO BINARY CONVERSION"
print"====================================================="
hex=input("Enter long hexadecimal to be converted: ")
s=hex
print "The binary of the hexadecimal is [",format(s, '0256b'),']'
print"====================================================="
I have messed this up so that it gives the following error:
SyntaxError: unexpected EOF while parsing
I would like to modify this to read from input file
hex_keys.txt
contain one hex key per line
Then output to binary_keys.txt
containing one binary key per line.
Thanks!