Off-Topic > Off-Topic - Tiny Tux's Corner

[Solved] Asking for recomendations on the shell script formatting.

<< < (8/10) > >>

jazzbiker:

--- Quote from: Rich on July 20, 2023, 11:28:02 AM ---Hi jazzbiker
It is included in the rootfs as  /usr/bin/micropython.

--- End quote ---
Thanks, Rich!
It is bigger than Lua.

Paul_123:
Depends on the features frozen into the main binary, and libraries included.  Micropython is even getting asyncio support.

Since I use Micropython/Circuitpython on baremetal too, I choose to stay python.


mocore:

--- Quote from: Paul_123 on July 20, 2023, 01:24:38 PM ---Depends on the features frozen into the main binary, and libraries included.  Micropython is even getting asyncio support.

--- End quote ---

after reading mention of micro python on this topic
i hapened to scrool past geophile/marcel:"A modern shell "  @ https://github.com/geophile/marcel#scripting




--- Quote ---marcel provides a Python API, allowing Python to be used as the scripting language.
While Python is sometimes considered to already be a scripting language, it isn't really.
Executing shell commands from Python code is cumbersome.
You've got to use os.system, or subprocess.Popen, and write some additional code to do the integration.

Marcel provides a Python module, marcel.api, which brings shell commands into Python in a much cleaner way.
For example, to list file names and sizes in /home/jao:
--- End quote ---

--- Code: ---from marcel.api import *

for file, size in ls('/home/jao') | map(lambda f: (f, f.size)):
    print(f'{file.name}: {size}')
--- End code ---

intresting

Greg Erskine:

--- Quote from: Rich on July 20, 2023, 11:28:02 AM ---Hi jazzbiker
It is included in the rootfs as  /usr/bin/micropython.

--- End quote ---

piCore has used micropython during the boot process for many years.

/usr/bin/tce-bootload is a micropython script called by tce-setup.

I think this was changed because, on the original Raspberry Pi's, this was the biggest bottleneck in the boot process.

jazzbiker:

--- Quote from: Greg Erskine on July 20, 2023, 05:41:28 PM ---
--- Quote from: Rich on July 20, 2023, 11:28:02 AM ---Hi jazzbiker
It is included in the rootfs as  /usr/bin/micropython.

--- End quote ---

piCore has used micropython during the boot process for many years.

/usr/bin/tce-bootload is a micropython script called by tce-setup.

I think this was changed because, on the original Raspberry Pi's, this was the biggest bottleneck in the boot process.

--- End quote ---

Hi Greg Erskine,

Thanks for the information. piCore's /usr/bin/tce-bootload actively uses os.fork() and os.waitforpid(). Definitely micropython's os module gives better control over background processes than shell.
I don't write python, please correct me if I am wrong - os module is imported and it means that it is not compiled into the micropython binary, right?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version