This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| scripting:python [2024/09/24 05:31] – jotasandoku | scripting:python [2024/12/23 13:46] (current) – S jotasandoku | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| **__PYTHON__**\\ | **__PYTHON__**\\ | ||
| - | \\ | + | |
| + | |||
| + | == FOLLOW PYTHON CODE (WIP) === | ||
| + | |||
| + | This is just covering the simple case of an installed python program which is invoked via interactive cli.\\ | ||
| + | I take [[https:// | ||
| + | |||
| + | The executable archive for the main command (argv[0]) must be present in a location contained in ' | ||
| + | |||
| + | # | ||
| + | import netsim | ||
| + | import netsim.cli | ||
| + | netsim.cli.lab_commands(__file__) | ||
| + | |||
| + | '' | ||
| + | |||
| + | * Inside netsim/ | ||
| + | * we have the function '' | ||
| + | * the standard module '' | ||
| + | |||
| + | ---- | ||
| **Python virtual environment**: | **Python virtual environment**: | ||
| \\ | \\ | ||
| Line 309: | Line 330: | ||
| """ | """ | ||
| \\ | \\ | ||
| - | Slicing lists\\ | + | == SLICING === |
| - | print namelist[:2] | + | |
| + | # [:2] - First 2 elements | ||
| + | print("[:2] ->", | ||
| + | |||
| + | # [2:] - Everything from index 2 onwards | ||
| + | print(" | ||
| + | |||
| + | # [-2:] - Last 2 elements | ||
| + | print(" | ||
| + | |||
| + | # [:-2] - Everything EXCEPT last 2 elements | ||
| + | print(" | ||
| + | |||
| + | |||
| + | |||
| \\ | \\ | ||
| Updating list | Updating list | ||
| Line 817: | Line 853: | ||
| __CODING NOTES__ | __CODING NOTES__ | ||
| * [[https:// | * [[https:// | ||
| - | * Use a 'list of unchecked cells'' | + | * Use a ''list of unchecked cells'' |
| pages_qty = len(page_numbers) + 1 | pages_qty = len(page_numbers) + 1 | ||
| Line 840: | Line 876: | ||
| * Moving-window average algorithm | * Moving-window average algorithm | ||
| * Sorted lists of numbers | * Sorted lists of numbers | ||
| - | |||
| - | |||
| - | ---- | ||
| - | |||
| - | == FOLLOW PYTHON CODE (WIP) === | ||
| - | |||
| - | This is just covering the simple case of an installed python program which is invoked via interactive cli.\\ | ||
| - | I take [[https:// | ||
| - | |||
| - | The executable archive for the main command (argv[0]) must be present in a location contained in ' | ||
| - | # | ||
| - | import netsim | ||
| - | import netsim.cli | ||
| - | netsim.cli.lab_commands(__file__) | ||