fork download
  1. import json
  2. from eth_account import Account
  3. import secrets
  4.  
  5. def evm_generator(ammount): #кидаем в функцию количество кошелей, которое хотим получить
  6. res = []
  7. for _ in range(ammount):
  8. priv = secrets.token_hex(32)
  9. private_key = "0x" + priv
  10. acct = Account.from_key(private_key)
  11. res.append({'addr': acct.address, 'pkey': private_key})
  12.  
  13. with open('pairs.json', 'w') as f:
  14. json.dump(res, f, indent= 4, separators=(',', ': '))
  15.  
  16. evm_generator(5)
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Traceback (most recent call last):
  File "/usr/lib/python3.7/py_compile.py", line 143, in compile
    _optimize=optimize)
  File "<frozen importlib._bootstrap_external>", line 791, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "./prog.py", line 8
    priv = secrets.token_hex(32)
                               ^
TabError: inconsistent use of tabs and spaces in indentation

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.7/py_compile.py", line 147, in compile
    raise py_exc
py_compile.PyCompileError: Sorry: TabError: inconsistent use of tabs and spaces in indentation (prog.py, line 8)
stdout
Standard output is empty