kliment / Printrun

Pronterface, Pronsole, and Printcore - Pure Python 3d printing host software
GNU General Public License v3.0
2.34k stars 994 forks source link

Use 3D printer communication with own Software #990

Open santiagocarod opened 5 years ago

santiagocarod commented 5 years ago

Hi,

FIrst of all let me say congratulations, I think this Software is really good and really easy to use,

I was wondering igf there is any kind of Api or interfaces or something similar so i can use the communication with the 3D printer but with my own software?

Like something where i can send commands to a function and it sends it to my 3D printer and i get back some kind of text or something like that?

Thank you for your assistance!

Sincerly,

Santiago Caro

benjaminforest commented 5 years ago

See printcore.py, you can pass it a handler written like eventhandler.py.

You'll get something like that:

from printrun import printcore

handler = YourHandler()
core = printcore.printcore()
core.addEventHandler(handler)
core.connect(port, baudrate)