user104853: I have code which generates WIF keys from hex keys.  It just need a few more lines to generate WIF addresses.
------------------------

import binascii, hashlib, base58, sys
def convert(z):
private_key_static = z

extended_key = "80"+private_key_static+"01"

first_sha256 = hashlib.sha256(binascii.unhexlify(extended_key)).hexdigest()

second_sha256 = hashlib.sha256(binascii.unhexlify(first_sha256)).hexdigest()

final_key = extended_key+second_sha256[:8]

WIF = base58.b58encode(binascii.unhexlify(final_key)).decode ('ascii')

print (WIF)

with open("HEX.txt") as file:
    for line in file:
       convert(str.strip(line))


user13440: Note: WIF is a format for private keys, not addresses.  There are multiple address formats, but the most common is P2PKH (hash of a public key).
I recommend looking that the code for Electrum to learn about how to work with public keys and addresses in Python, (check out bitcoin.py).  It contains everything you need and is reliable code used by many thousands of users to secure their bitcoin.

104853: <p>I have code which generates WIF keys from hex keys.  It just need a few more lines to generate WIF addresses.</p>

<h1>------------------------</h1>

<p><B><PRE>
import binascii, hashlib, base58, sys</p>

<p>def convert(z):</p>

<pre><code>private_key_static = z

extended_key = "80"+private_key_static+"01"

first_sha256 = hashlib.sha256(binascii.unhexlify(extended_key)).hexdigest()

second_sha256 = hashlib.sha256(binascii.unhexlify(first_sha256)).hexdigest()

final_key = extended_key+second_sha256[:8]

WIF = base58.b58encode(binascii.unhexlify(final_key)).decode ('ascii')

print (WIF)
</code></pre>

<p>with open("HEX.txt") as file:
    for line in file:
       convert(str.strip(line))</p>

<p></PRE></B></p>
 13440: <p>Note: <a href="https://en.bitcoin.it/wiki/Wallet_import_format" rel="nofollow noreferrer">WIF</a> is a format for private keys, not addresses.  There are multiple address formats, but the most common is P2PKH (<strong>hash</strong> of a <em>public</em> key).</p>

<p>I recommend looking that the code for Electrum to learn about how to work with public keys and addresses in Python, (check out <a href="https://github.com/spesmilo/electrum/blob/master/electrum/bitcoin.py" rel="nofollow noreferrer">bitcoin.py</a>).  It contains everything you need and is reliable code used by many thousands of users to secure their bitcoin.</p>
