We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 653a0c2 commit a3cd349Copy full SHA for a3cd349
tools/mpy_bin2res.py
@@ -0,0 +1,18 @@
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
9
+import sys
10
+
11
+print("R = {")
12
13
+for fname in sys.argv[1:]:
14
+ with open(fname, "rb") as f:
15
+ b = f.read()
16
+ print("%r: %r," % (fname, b))
17
18
+print("}")
0 commit comments