What I'm trying to do is getting some input from the keyboard, store
in a list and then fire pyke rules for the elements in this list.
I'm actually doing this with three files: main.py, global_var.py and notes.krb
In global_var I just define two empty lists:
input_notes = []
input_num = []
In main.py I do this:
global_var.input_notes = raw_input('insert input ').split(' ')
engine = knowledge_engine.engine(m_ia)
engine.reset()
engine.activate('notes')
And then in notes.krb:
third
foreach
python print 'bla'
$A in global_var.input_notes
python print $A
fc_extras
from m_ia import global_var
I trimmed a lot of code away, to show the important parts. Anyway, the
raw_input() is working and I'm sure that before it printed the $A
variable correctly. Now it just prints "bla".
Any idea?
Thanks.
Thanks, you're right.
In a file I was doing:
from global_var import input_notes
and in the rule base:
from m_ia import global_var
Thanks again,
Carlo