wendlers / mpfshell

A simple shell based file explorer for ESP8266 Micropython based devices ⛺
MIT License
396 stars 84 forks source link

How to run scripts #75

Closed cecchisandrone closed 5 years ago

cecchisandrone commented 5 years ago

Is it possible to run scripts using mpfshell (like run command in ampy)? Thanks.

barbudor commented 5 years ago

I don't know ampy but you can use the REPL console (>>>) if this is what you are looking for.

skorokithakis commented 5 years ago

That is correct, you can use the REPL and run whatever script is on the microcontroller.

cecchisandrone commented 5 years ago

I don't know ampy but you can use the REPL console (>>>) if this is what you are looking for.

What is the command?

barbudor commented 5 years ago

Have you tried to use ? orhelpcommands ? It's there, hidden in plain sight: screenshot 5

cecchisandrone commented 5 years ago

I mean running a script from repl Il 28 mar 2019, 19:40 +0100, Barbudor notifications@github.com, ha scritto:

Have you tried to use ? orhelpcommands ? It's there, hidden in plain sight: — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

barbudor commented 5 years ago

Oh. Sorry for the misunderstanding and little moking. That's not related to mpfshell itself. It would be the same whatever terminal you use (uPyCraft, Mu, ...) I'm using import nameofscript (without the .py) but not sure if that's the only way. Note that import is not just exactly 'running'. That's importing and compiling the code and executing the part of the code that is at the root level (outside of any def or class). Which means that you cannot re-import again to re-execute as the module has already been imported. I suggest you move this question/discussion to MicroPython forum: https://forum.micropython.org/

cecchisandrone commented 5 years ago

Normally I do this in ampy (run command). The problem of that shell is that you see the output of the script only when it terminates, so I was trying to find an alternative. Il 28 mar 2019, 20:10 +0100, Barbudor notifications@github.com, ha scritto:

Oh. Sorry for the misunderstanding and little moking. That's not related to mpfshell itself. It would be the same whatever terminal you use (uPyCraft, Mu, ...) I'm using import nameofscript (without the .py) but not sure if that's the only way. Note that import is not just exactly 'running'. That's importing and compiling the code and executing the part of the code that is at the root level (outside of any def or class). Which means that you cannot re-import again to re-execute as the module has already been imported. I suggest you move this question/discussion to MicroPython forum: https://forum.micropython.org/ — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

skorokithakis commented 5 years ago

Hmm, I'm not entirely sure what you want to do. Do you want to run a script that's on the computer, or on the MPU?

cecchisandrone commented 5 years ago

On the MPU. Il 28 mar 2019, 23:29 +0100, Stavros Korokithakis notifications@github.com, ha scritto:

Hmm, I'm not entirely sure what you want to do. Do you want to run a script that's on the computer, or on the MPU? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.