Bitcoin wallet address and private key generator
IMPORTANT!!!
Not a Python tip, but rather a MUST when it comes to sensitive information (quote from @nzall's comment):

Those private keys should NEVER, EVER be posted in a location even
as remotely public as a code review site. More, replacing them
is not enough. For all purposes, you should now view the original keys as compromised and must NEVER EVER EVER use them again for
bitcoin storage. Doing so runs high risk of losing the bitcoins stored
in them

I just made this tip a bit more seeable for everybody.

Another three small observations, in addition to what @Graipher said.
In Python you can &quot;chain&quot; comparison operations which just means they are &quot;and&quot;ed together.
if random_int &gt;= 1 and random_int &lt; curve_order:
    return random_int

In your case, it'd be like this:
if 1 &lt;= random_int &lt; curve_order:
    return random_int

Read more about it here

More, I'd recommend you use .format() when it comes to printing:
print(&quot;Private Key: &quot; + private_key_hex)
print(&quot;Public Key: &quot; + public_key_hex)
print(&quot;Private Key (WIF Format): &quot; + private_key_wif_hex)

Could be:
print(&quot;Private Key: {}&quot;.format(private_key_hex))
print(&quot;Public Key: {}&quot;.format(public_key_hex))
print(&quot;Private Key (WIF Format): {}&quot;.format(private_key_wif_hex))


You should also have two blank lines between your functions (instead of a single one)
This:
# ...
from binascii import hexlify, unhexlify

def random_secret_exponent(curve_order):
    while True:
        random_hex = hexlify(dev_random_entropy(32))
        random_int = int(random_hex, 16)
        if random_int &gt;= 1 and random_int &lt; curve_order:
            return random_int

def generate_private_key():
    curve = ecdsa.curves.SECP256k1
    se = random_secret_exponent(curve.order)
    from_secret_exponent = ecdsa.keys.SigningKey.from_secret_exponent
    return hexlify(from_secret_exponent(se, curve, hashlib.sha256).to_string())

# ...

Should be:
# ...
from binascii import hexlify, unhexlify


def random_secret_exponent(curve_order):
    while True:
        random_hex = hexlify(dev_random_entropy(32))
        random_int = int(random_hex, 16)
        if random_int &gt;= 1 and random_int &lt; curve_order:
            return random_int


def generate_private_key():
    curve = ecdsa.curves.SECP256k1
    se = random_secret_exponent(curve.order)
    from_secret_exponent = ecdsa.keys.SigningKey.from_secret_exponent
    return hexlify(from_secret_exponent(se, curve, hashlib.sha256).to_string())


# ...

For more details / suggestions / improvements regarding your code layout, you could take a look at PEP8, Python's official style guide.