Hi,
how can I execute an external program/os shell from the Unix version?
Thanks... Béla
Executing external program on Linux
Executing external program on Linux
Tiny Core Linux (piCore) developer
HAM radio call: HA5DI (Béla)
HAM radio call: HA5DI (Béla)
Re: Executing external program on Linux
Just the same as usual - e.g. os.system(), os.pipe(). There's no "subprocess" module currently.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: Executing external program on Linux
Thanks, os.system() and os.pipe() is suitable. On our TC (Tiny Core) Linux we have several applications written in shell (BusyBox ASH). In general it is OK, but there are few more complex cases where ASH programming is a pain. I think micropython can be a good choice to migrate shell scripts to Python, but need some work to port scripts and make an evaluation.
Tiny Core Linux (piCore) developer
HAM radio call: HA5DI (Béla)
HAM radio call: HA5DI (Béla)
Re: Executing external program on Linux
That's exactly the usecase for the unix version of MicroPython, I e.g. wanted to be able to write Python scripts/apps for OpenWRT which would work with just builtin flash, where CPython just won't fit. Feel free to share your experiences, report missing functionality to https://github.com/micropython/micropython-lib/issues , or even better, contribute missing parts .
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: Executing external program on Linux
Good to see others are doing the same. Tested, os module works fine, so I have everything to start testing some code on the Raspberry Pi with piCore Linux.
Tiny Core Linux (piCore) developer
HAM radio call: HA5DI (Béla)
HAM radio call: HA5DI (Béla)
Re: Executing external program on Linux
So far it looks good. I'm installing extensions during startup dynamically using a dictionary and lists. The only issue is the low default RAM size in UNIX build, 128k. I'm running out memory frequently even with moderate size and simple dicts. Running gc explicitely helps a bit.
I opened a ticket to increase default size.
https://github.com/micropython/micropython/issues/1433
I opened a ticket to increase default size.
https://github.com/micropython/micropython/issues/1433
Tiny Core Linux (piCore) developer
HAM radio call: HA5DI (Béla)
HAM radio call: HA5DI (Béla)