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.
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
now you can get it from WRC as Preview. 2012.2.617 + a studio that understands Py
Hello.
Talking about this example:
I'd like to make the python method SayHiPy() equal to SayHiCOS() but:
1) when i call self.nameProp I get an Undefined on "self".
2) how can i get the class Parameter's value?
3) how can i call Objectscript methods in the same class from within the Python one, like calling SayHiCOS from SayHiPy?
Thank you