如何在python中添加计数器和平均每分钟结果数

How to add counter & Avg Number of results per minute in python

提问人:Mohit Kumar 提问时间:12/7/2022 最后编辑:Mohit Kumar 更新时间:12/8/2022 访问量:66

问:

我有这段代码,我在其中随机生成助记词种子并获取 Eth 地址。

所以我想贴我的计数器和平均每分钟结果数,以便在我打印后。它会显示我生成了多少个以太地址,如果可能的话,它还会显示我每分钟获得的平均结果数,例如每分钟 100 个以太地址。

(我正在使用 2 个助记符,因为我想提高它的速度)

这是我第一次在这里发布问题,所以我希望我能够正确地传达我的问题

# import threading
from hdwallet import BIP44HDWallet
from hdwallet.cryptocurrencies import EthereumMainnet
from hdwallet.derivations import BIP44Derivation
from hdwallet.utils import generate_mnemonic
from typing import Optional
from requests import get
import requests

while True:

    #Generate Mnemonic 12 words
    mnemonic1: str = generate_mnemonic(language="english", strength=128)
    mnemonic2: str = generate_mnemonic(language="english", strength=128

    #Generate ETH Address from Mnemonic
    bip44_hdwallet: BIP44HDWallet = BIP44HDWallet(symbol=ETH, account=0, change=False, address=0)
    bip44_hdwallet.from_mnemonic(mnemonic=mnemonic1)
    ETH1_address = bip44_hdwallet.address()
    
    #Generate ETH Address from Mnemonic
    bip44_hdwallet: BIP44HDWallet = BIP44HDWallet(symbol=ETH, account=0, change=False, address=0)
    bip44_hdwallet.from_mnemonic(mnemonic=mnemonic2)
    ETH2_address = bip44_hdwallet.address()

    print("Mnemonic1 =", (mnemonic1) , "\nMnemonic2 =", (mnemonic2))
    print("ETH1_address =", (ETH1_address) , "\nETH2_address =", (ETH2_address))


-----------------------------------Output I Want ---------------------------------

mnemonic1 = seed .......
Mnemonic2 = seed2 .......
ETH1_address = Eth address .......
ETH2_address = Eth address2 ........



Counter Stick here
Counter = #No of its printing like in above its 2 address
Avg Result/Min = #If possible
python-3.x 以太坊 区块 助记词

评论


答: 暂无答案