This reminds me of something I wanted to do when  building pyui.

IIRC I wanted to invoke  emccannon...


Here is the relevant remarks from Michael H.. maybe similar answer

to what you are asking maybe not.


Chris M

> I wish to import emccanon to my handler file but python
> can't find the module.
>
> this is not going to work even if you can import the emccanon module (grep 
> for '"emccanon"' to find how it would be done if it worked)
>
> this is why:
> emccanon assumes it is running inside the task process and adds nml commands 
> to the interplist
> if you link that code outside of task into your panelui, the nml commands 
> will not make it to task
>
> task has no api to inject canon commands except through this in-memory list
>
> the embedded python case does work for the remapping code because it runs 
> inside task
>
> you just found on of the design inanities... a key api is not an api because 
> you cannot talk to it
>
> sorry to spoil the idea..

________________________________
From: andy pugh <[email protected]>
Sent: December 1, 2017 11:41 AM
To: EMC developers
Subject: [Emc-developers] Interpreter in Python

In remap code you can use:
from intepreter import *

and have acces to the (largely undocumented) interpreter Python interface:
https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/rs274ngc/interpmodule.cc
[https://avatars0.githubusercontent.com/u/5650508?s=400&v=4]<https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/rs274ngc/interpmodule.cc>

LinuxCNC/linuxcnc<https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/rs274ngc/interpmodule.cc>
github.com
linuxcnc - LinuxCNC controls CNC machines. It can drive milling machines, 
lathes, 3d printers, laser cutters, plasma cutters, robot arms, hexapods, and 
more.



But how can you import that module into Python that is _not_ part of a
G-code remap ?

--
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to