Title: Hex to Binary script Post by: whohackedme on August 22, 2018, 05:31:41 PM 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: Code: 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! Title: Re: Hex to Binary script Post by: HCP on August 23, 2018, 11:44:24 PM I have a small script that reads HEX and outputs WIF... Fairly sure I had a similar EOF issue before I started using the "line.strip()" to strip out stray EOL and other whitespace characters (like an empty line at the end of the file etc).
it should be fairly easy to modify this code so instead of outputting WIF, it simply converts to binary. Code: import bitcoin Anyway, are you able to show your code here so myself (and others) can try and debug why you're getting that error? ??? |