Post
Topic
Board Project Development
Merits 1 from 1 user
Re: how to convert xprv to wif or (hex) 1,2,3 address index (python)
by
NotATether
on 02/06/2022, 08:00:34 UTC
⭐ Merited by ETFbitcoin (1)
You can make a wrapper script around bip32gen, in a single file using `os.spawnl` to create a bip32gen subprocess and wait for it to exit. The wrapper will just read the list of keys from a file and loop through them.

Code:
#!/usr/bin/python3
import os

keys = []
file = open('keys.txt' 'r')
for l in file:
    keys.append(l.strip('\n'))
for k in keys:
    os.spawnl(os.P_WAIT, '/path/to/bip32gen', ['cmd', 'options', 'as', 'list'])