forex.pm forex forum binary options trade

 Сryptocurrency exchanges => Binance - Сryptocurrency exchanges => Topic started by: Bitcoin on Feb 06, 2022, 06:48 am

Title: Using the Bitcoin python library to generate Private Key [Noob question]
Post by: Bitcoin on Feb 06, 2022, 06:48 am
Using the Bitcoin python library to generate Private Key [Noob question]

I have done pip install bitcoin and then wrote the below code:


from bitcoin import *
private_key = random_key()
print(private_key)

Now I am getting this error:


Traceback (most recent call last):
  File "/Users/praveen/Documents/code/sandbox/python/bitcoinkey.py", line 1, in <module>
    from bitcoinkey import *
  File "/Users/praveen/Documents/code/sandbox/python/bitcoinkey.py", line 2, in <module>
    private_key = random_key()
NameError: name 'random_key' is not defined

Any idea why 'random_key' is not defined?


Thanks,
Just getting started with tinkering.


Source: Using the Bitcoin python library to generate Private Key [Noob question] (https://bitcoin.stackexchange.com/questions/112279/using-the-bitcoin-python-library-to-generate-private-key-noob-question)