I’m coding something for my business that allows me to choose my own specific ethereum wallets by generating them. I combined the wallet address and private key of ethereum accounts in my script but I want when I run the function in my iterator the combined wallet address and private key to increment and decrement alphabetically so I can choose a wallet address I like.
I coded most of this already. My code so far is:
import concurrent.futures
import secrets
import binascii
from web3 import Web3
from eth_account import Account
import time
# Function to generate a new unique private key
def generate_private_key():
random_bytes = secrets.token_bytes(32)
hex_string = binascii.hexlify(random_bytes).decode('utf-8')
account = Account.from_key(hex_string)
#print(hex_string+account.address[2:])
return hex_string + account.address[2:]
def run_same():
private_key = generate_private_key()
# check_private_key(private_key, wallet_address_to_find="0x5a52E96BAcdaBb82fd05763E25335261B270Efcb")
#speed is equal to once 1000e79 of a second
class MyIterator:
def __init__(self, limit):
self.limit = limit
self.current = 0
def __iter__(self):
return self
def modify_speed(self):
pass
def __next__(self):
if self.current < self.limit:
self.current += 1
return self.current
else:
raise StopIteration
# Example usage:
iterator = MyIterator(4)
for item in iterator:
run_same()
I want to sort up and down with the combined string only its for my business. Can someone show me what to do