nxt package
Subpackages
Submodules
Module contents
- execute_graph(filepath, start=None, parameters=None, context=None)[source]
Shortest code path to executing a graph from the nxt package. Creates a 1 off session and executes the graph within that session. Arguments are a direct copy of Session.execute_graph, see there for full details.
- Parameters
filepath (str) – Path to the graph file.
start (str) – Path to the node to begin execution from.
parameters (dict) – Dict where key is attr path and value is new attr value.
context (str) – Optional name of remote context to execute graph in, if none is passed the graph is executed in this interpreter.
- create_context(custom_name, interpreter_exe='D:\\claude_scratch\\nxt_port\\venv_sphinx\\Scripts\\python.exe', context_graph=None, exe_script_args=())[source]
Generate a remote context given the path to an interpreter executable, if none is provided the current sys.executable is used. You must provide a custom name for your context. If no errors are raised, the context should be available without restarting NXT.
- Parameters
interpreter_exe – String path to Python executable. If another executable is supplied a script to call with that executable is expected.
custom_name – String of context name. The name users will refer to the context by
context_graph – Optional path to an existing context startup graph
exe_script_args (list | tuple) – If the exe arg is not a Python interpreter additional args may need to passed. For example in Blender its possible to call the blender.exe with the arg –python. After the args the path to the nxt cli module is inserted into the subprocess call.
- Raises
IOError, NameError
- Returns
string of the new context name