trueagi-io / metta-examples

Discussion of MeTTa programming with examples
MIT License
20 stars 18 forks source link

Debug py #31

Closed DaddyWesker closed 8 months ago

DaddyWesker commented 10 months ago

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

@Necr0x0Der

mvpeterson commented 9 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 9 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 9 months ago

@mvpeterson I've added your variant of debugging.

astroseger commented 9 months ago

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

DaddyWesker commented 9 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 9 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 9 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 9 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 9 months ago

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

Necr0x0Der commented 9 months ago

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

astroseger commented 8 months ago

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