os - OS Functions

The os module allows access to a few core functionalities of Epicardium and functions found in CPythons os module.

CPython-Like

Unlink (remove) a file.

Parameters

path (str) – The file to remove.

os.listdir(dir)

List contents of a directory.

Parameters

dir (str) – Path to the directory to list.

Returns

A list of entities (files or subdirectories) in the directory dir.

Epicardium-Specific

os.exit(ret = None)

Exit from the current app and return to the menu.

Parameters

ret (int) – Optional return code, same semantics as Posix (0 means success).

Returns

This function will never return.

os.exec(name)

Try executing a new app, stopping the currently running one.

name is the path to either a l0dable (ending in .elf) or a python script (ending in .py). If the path does not lead to an executable file, os.exec() will raise an exception.

Parameters

name (str) – Path to new app/script/l0dable.

Returns

This function never returns. It can, however raise an exception.