trueagi-io / metta-examples

Discussion of MeTTa programming with examples
MIT License
14 stars 15 forks source link

Debug py #31

Closed DaddyWesker closed 3 months ago

DaddyWesker commented 5 months ago

Tutorial to debug python scripts launched inside metta scripts using Pycharm GUI.

@Necr0x0Der

mvpeterson commented 5 months ago

If you want to use the Pycharm IDE for debugging an imported python script, you can just create a "Run/Debug" configuration for the hyperon-experimental/python/hyperon/metta.py script and add a path to your .metta script file as an input parameter.

DaddyWesker commented 5 months ago

If you want to use the Pycharm IDE for debugging an imported python script, you can just create a "Run/Debug" configuration for the hyperon-experimental/python/hyperon/metta.py script and add a path to your .metta script file as an input parameter.

O'kay, probably i can.

DaddyWesker commented 4 months ago

@mvpeterson I've added your variant of debugging.

astroseger commented 4 months ago

By the way, example will not work with the last version since API for import python files has changed.

DaddyWesker commented 4 months ago

By the way, example will not work with the last version since API for import python files has changed.

Really? You tried already?

astroseger commented 4 months ago

By the way, example will not work with the last version since API for import python files has changed.

Really? You tried already?

At least for me it doesn't work. I replaced

!(extend-py! additional_funcs.py)

with

!(import! &self additional_funcs)

To make it work.

But maybe there are other ways.

DaddyWesker commented 4 months ago

I need to check this. Import of py files already changed once. It was !(extend-py! additional_funcs) then !(extend-py! additional_funcs.py) Now it is import. Okay, I'll check this one and make fixes to .md file. I hope this is the last time import changes =)

astroseger commented 4 months ago

I need to check this. Import of py files already changed once. It was !(extend-py! additional_funcs) then !(extend-py! additional_funcs.py) Now it is import. Okay, I'll check this one and make fixes to .md file. I hope this is the last time import changes =)

The API needs to be changed more often so that developers do not relax.

DaddyWesker commented 4 months ago

Okay, I've updated the readme file with new import instead of extend-py.

Necr0x0Der commented 4 months ago

@astroseger , please approve this PR if/when you think it is ok

astroseger commented 3 months ago

I've tried both ways. I find the "Alternative way" more simple. But in principle both work.