@@ -50,12 +50,28 @@ This brings some advantages, like programs starting significantly faster than
50
50
regular Python, but comes at the cost at not being fully compatible with code
51
51
written for regular Python.
52
52
53
+ MicroPython works as a different Python interpreter, rather than as a library.
54
+ It can be invoked by running it from the command line, for example:
55
+ ` micropython -c "import sys; print(sys.version)" ` or
56
+ ` micropython -c "from ev3dev2.sound import Sound; Sound().speak('hello world')" ` .
57
+ You may add this as the first line of your Python script to run it with MicroPython:
58
+ ` #!/usr/bin/env micropython ` .
59
+
60
+ ** TIP:** ` ev3dev-lang-python ` is also partially compatible with MicroPython.
61
+
53
62
[ Pybricks] is a specialized version of MicroPython for LEGO MINDSTORMS and LEGO
54
63
Powered Up smart hubs. Pybricks v2.0 is used by LEGO Education as their [ Python
55
64
for EV3] ( https://education.lego.com/en-us/product-resources/mindstorms-ev3/teacher-resources/python-for-ev3 )
56
65
solution and is the same version that is available in ev3dev-stretch.
57
66
58
- ** TIP:** ` ev3dev-lang-python ` is also partially compatible with MicroPython.
67
+ You may run Pybricks from command line like this:
68
+ ` brickrun -r -- pybricks-micropython -c "from pybricks.hubs import EV3Brick; EV3Brick().speaker.beep()" ` .
69
+ You may add this as the first line of your Python script,
70
+ ` #!/usr/bin/env pybricks-micropython ` ,
71
+ and then run it from the brick's file browser to run it with Pybricks.
72
+
73
+ ** TIP:** If you are into using Python's interactive mode when trying Pybricks,
74
+ you can use ` brickrun -r -- pybricks-micropython ` , or its shortcut ` pybricks-repl ` .
59
75
60
76
[ Get started with MicroPython] ( https://pybricks.github.io/ev3-micropython/ ) {: .btn .btn-default }
61
77
0 commit comments