value between [] in python

Hi everyone,

I would like to use this:

Code:

[string trimleft [lindex [split [string trim [file tail [value root.name]] .nk] _] 1] v]


into a var python:

Code:

n = nuke.toNode("NoOp1")
shotversion = ('[string trimleft [lindex [split [string trim [file tail [value root.name]] .nk] _] 1] v]')


What is the correct structure to write it and return the value?

I use it to create a directory…

Thx a lot

No Responses to “value between [] in python”

Post a Comment