1#!/usr/bin/env python3
2#
3# This tool converts binary resource files passed on the command line
4# into a Python source file containing data from these files, which can
5# be accessed using standard pkg_resources.resource_stream() function
6# from micropython-lib:
7# https://github.com/micropython/micropython-lib/tree/master/pkg_resources
8#
9import sys
10
11print("R = {")
12
13for fname in sys.argv[1:]:
14    with open(fname, "rb") as f:
15        b = f.read()
16        print("%r: %r," % (fname, b))
17
18print("}")
19