jupyter_micropython_kernel icon indicating copy to clipboard operation
jupyter_micropython_kernel copied to clipboard

Implement a way of executing local system commands via the micropython kernel

Open MatthewCroughan opened this issue 5 years ago • 0 comments

I want to run external tools such as pycom's dfu-util from the single notebook I'm working in, rather than the included esptool.

In the python3 kernel this would be

import os
os.system(“your command here”)

This is only because of the fact that you are running the kernel on the host system, whereas in this case the micropython kernel only has access to the device on serial its talking to. What I'm suggesting would be to give access to the system's python3 via a micropython kernel command.

if the scope is wide maybe this could be %hostkernel to simply let people run py files located on the host system. If the scope is small perhaps %bash or %shell could be used, and then a single command along with all its own parameters are ran on the user's system shell, this excludes usefulness on other platforms like Windows however, unless you make it aware of the existence of bash on Windows via Cygwin or Windows Subsystem for Linux (WSL).

MatthewCroughan avatar May 08 '19 10:05 MatthewCroughan