Replies: 4 comments 6 replies
-
Take a look at mpremote https://docs.micropython.org/en/latest/reference/mpremote.html |
Beta Was this translation helpful? Give feedback.
-
As suggested by @Jeff-Squared , mpremote is a great way to work with the micropython repl from within a terminal/cli. To install micropython onto your device from the command line, check the install instructions for your device (you didn't mention which board type you are using) on the micropython downloads page (https://micropython.org/download/). For and esp32 device, esptool is your friend. |
Beta Was this translation helpful? Give feedback.
-
If you like mpremote you probably also like mpy-cross: $ mpy-cross --help
usage: mpy-cross [<opts>] [-X <implopt>] [--] <input filename>
Options:
--version : show version information
-o : output file for compiled bytecode (defaults to input filename with .mpy extension, or stdout if input is stdin)
-s : source filename to embed in the compiled bytecode (defaults to input file)
-v : verbose (trace various operations); can be multiple
-O[N] : apply bytecode optimizations of level N
Target specific options:
-msmall-int-bits=number : set the maximum bits used to encode a small-int
-march=<arch> : set architecture for native emitter; x86, x64, armv6, armv6m, armv7m, armv7em, armv7emsp, armv7emdp, xtensa, xtensawin
Implementation specific options:
emit={bytecode,native,viper} -- set the default code emitter
heapsize=<n> -- set the heap size for the GC (default 2097152) mpy-tool $ mpy-tool -h
usage: mpy-tool [-h] [-x] [-d] [-f] [--merge] [-q QSTR_HEADER]
[-mlongint-impl {none,longlong,mpz}] [-mmpz-dig-size N]
[-o OUTPUT]
files [files ...]
A tool to work with MicroPython .mpy files.
positional arguments:
files input .mpy files
options:
-h, --help show this help message and exit
-x, --hexdump output an annotated hex dump of files
-d, --disassemble output disassembled contents of files
-f, --freeze freeze files
--merge merge multiple .mpy files into one
-q QSTR_HEADER, --qstr-header QSTR_HEADER
qstr header file to freeze against
-mlongint-impl {none,longlong,mpz}
long-int implementation used by target (default mpz)
-mmpz-dig-size N mpz digit size used by target (default 16)
-o OUTPUT, --output OUTPUT
output file |
Beta Was this translation helpful? Give feedback.
-
If you find yourself using VS Code, I have a couple extensions that might interest you. They are wrappers around the esptool and mpremote Python modules to give you point and click access to the tools from within VS Code. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am new to micropython, Currently I am using it in Thonny ide.
Is there any way to install it in the terminal (or command prompt) like standard python?
Beta Was this translation helpful? Give feedback.
All reactions