Touch Designer from cmd line or terminal?

Is it possible to import the td module outside of Touch Designer? I can see the import in the “TouchDesigner099\bin\TouchInit.py” file, but can’t figure out where it’s coming from.

Or, is there a way to launch Touch Designer from the command line and run a .py upon startup?

The only way I can think to do this is have a simple pre-made .toe file with an executeDAT set to the start event. Then, in the onStart() function load and run .py files from a directory. I will try this for now.

Then execute via cmd line: "C:\Program Files\Derivative\TouchDesigner099\bin\touchdesigner099.exe" "E:\path\to\unit_test_launcher.toe"

Here’s what I came up with:

[url]https://github.com/jacobmartinez3d/TD_Unit_Test_Launcher[/url]

The master branch version is a starting point - it just imports any py files in a directory and writes their dir() output to a txt.

The unittest branch is my end goal which is to incorporate python’s unittest module but I’m new to it and keep running into exceptions in TD… :blush: