eth-faucet/python/eth_faucet/runnable/gen.py

23 lines
544 B
Python

# standard imports
import sys
import os
import argparse
script_dir=os.path.dirname(os.path.realpath(__file__))
data_dir=os.path.join(script_dir, '..', 'data')
tr={
'faucet': 'EthFaucet',
'period': 'PeriodSimple',
}
argparser = argparse.ArgumentParser()
argparser.add_argument('name', type=str, default='faucet', choices=['faucet', 'period'], help='list code identifiers')
args = argparser.parse_args(sys.argv[1:])
fp = os.path.join(data_dir, tr[args.name] + '.bin')
f = open(fp, 'r')
r = f.read()
f.close()
print(r)