Is it possible for nuke -t to behave like mayapy interpreter?

i m not sure if there is any nuke user onboard but who ever has knowledge of this please tell me
like we can send command or import script to mayapy test.py

can we do it with nuke like this

E:\Program Files\Nuke6.1v3>Nuke6.1.exe -t import sys

it launched nuke in terminal window in CMD prompt with nuke python interpreter

but in the end i got this message saying

Can’t read E:/Program Files/Nuke6.1v3/import: No such file or directory

nuke -t is used to execute a python script, not run python commands:

http://docs.thefoundry.co.uk/nuke/63/pythondevguide/command_line.html

alright!! so does that mean with that script passed to nuke -t we can open nuke scene in command line , using nuke.scriptOpen(?) ?

Yeah. There’s an example of that in the docs I linked.

not the topic of the thread but curious is nuke.root()[‘last_frame’].value() be the last frame of the script or the write node , if not how do i get the last frame specified in the write node ?

The root node holds script-wide values. You have to specify the name of the node if you want node-specific values. Nuke doesn’t know what “the write node” is, since you can have multiple write nodes in a scene. Also what do you mean by the last frame in the write node? Are you referring to the frame range limit? Because you only specify the range to render at render time.

For a specific node:

writenode = nuke.toNode(my_write_node)
# Gets the frame range limit
first = writenode['first'].value()
last = writenode['last'].value()

For all write nodes:

writes = {}
for node in nuke.allNodes():
    if node.Class() == 'Write':
        first = node['first'].value()
        last = node['last'].value()
        writes[node.name()] = (first, last)