Article
Robert Cemper · Jan 19 2m read

Trying Embedded Python

This was my first attempt to use Embedded Python in IRIS
The Python code is adapted from solutions for Advent of Code 2020 contest.
Test data are all input to my personal challenge.

Make sure you have git and Docker desktop installed.

Installation

Clone/git pull this repo into any local directory

$ git clone https://github.com/rcemper/try_embedded_python  

Open the terminal in this directory and run:

$ docker-compose build

this may take some time to complete

Run the IRIS container with this project:

$ docker-compose up -d

How to Test it

Using IRIS terminal:

$ docker-compose exec iris iris session iris "##class(rccpy.AoC20).Run()"

Welcome to embedded Python Demo
select day as described on https://adventofcode.com/
day 0 to exit
     day (1..25) [1]:
+++++ starting : day1 +++++++++
     select part (1,2,*=all,0=skip) [*] :1
     part 1: 181044
     select part (1,2,*=all,0=skip) [*] :2
     part 2: 82660352
     select part (1,2,*=all,0=skip) [*] :0
+++++++++ done : day1 +++++++++
     day (1..25) [2]:
+++++ starting : day2 +++++++++
     select part (1,2,*=all,0=skip) [*] :*
     part 1: 456
     part 2: 308
+++++++++ done : day2 +++++++++
     day (1..25) [3]:

Hints

Directory .stream/ contains all my input files and some public test data.
If you want to use your personal input you should replace them as 1 file by day.
e.g. input01.txt, input02.txt,........ ,input25.txt exactly as downloaded from AOC2020.

%SYS.Python.html is a preliminary class docu to see available functions

run time: for most tests replies are pretty immediate.
But a few tests take a quite long time for calculations before showing a reaction.
Don't get nervous for day 11, 15!!, 17, 19, 22, 23.

80
0 1 2 434
Log in or sign up to continue

Is it possible to have a version if this that doesn't require docker? I can't run docker on my laptop and am still getting my docker on Ubuntu on my Pi up and running. 

I use the version I got for EAP

IRIS for Windows (x86-64) 2021.1.0PYTHON (Build 237U) Wed Jun 2 2021 10:38:20 EDT