You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
497 B

#!/usr/bin/env python3
# This tool converts binary resource files passed on the command line
# into a Python source file containing data from these files, which can
# be accessed using standard pkg_resources.resource_stream() function
# from micropython-lib:
import sys
print("R = {")
for fname in sys.argv[1:]:
with open(fname, "rb") as f:
b =
print("%r: %r," % (fname, b))