External lib : Python Serial or Serial DAT ?

hello,

I am trying to play with a small DIY thermal printer under TD.
I found some libraries. Some are C++ and others Python libs.

I would like to give the python lib a try but i have some issues and questions :

  1. if i understand correctly, we can’t import external libs in TD. The way to go is to copy/paste python code into text DAT and call them from there ?

  2. the lib makes use of serial communications using the Serial python class. Do i need to use this class (so i would need to install this python module first on my OS) os can i substitue it to use the TD serial DAT instead ? I have to figure how to do this though…

thanks a lot

for the record, this is the python lib i am trying to import :

github.com/chriszirkel/Python-Thermal-Printer

see this paragraph on wiki which explains how to install & import external Python modules into TD.
docs.derivative.ca/Introduction … ng_Modules

thanks. I had a look bu i am working on macOS. Anyone knows the TD python path on mac ?

Should just be able to look at the sys.path in TD to see what it is using…

[code]import sys

for thing in sys.path:
print thing
[/code]

hi,

here is what i get :

python >>> ['/Applications/TouchDesigner099.app/Contents/MacOS', '/Applications/TouchDesigner099.app/Contents/MacOS/Lib', '/Applications/TouchDesigner099.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5', '/Applications/TouchDesigner099.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages', '/Applications/TouchDesigner099.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/lib-dynload', '/Applications/TouchDesigner099.app/Contents/MacOS/lib/python35.zip', '/Applications/TouchDesigner099.app/Contents/MacOS/lib/python3.5', '/Applications/TouchDesigner099.app/Contents/MacOS/lib/python3.5/plat-darwin', '/Applications/TouchDesigner099.app/Contents/MacOS/lib/python3.5/lib-dynload', '/Applications/TouchDesigner099.app/Contents/Resources/tfs/Config/Cmd', '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5']

So i have my python paths but where do i have to put my python lib which i downloaded from github and import it in a script inTD ?

thanks