Hello Srdjan,
here's the script that starts another python script as a network task:
import PhotoScan
client = PhotoScan.NetworkClient()
task1 = PhotoScan.NetworkTask()
task1.name = 'RunScript'
task1.params['path'] = "processing/script.py" #path to the script to be executed
task1.params['args'] = "argument1 argument2" #string of the arguments with space as separator
path = "processing/project.psx"
client.connect('192.168.0.2') #server ip
batch_id = client.createBatch(path, [task1])
client.resumeBatch(batch_id)
print("Job started...")
and here's the script.py that should be executed as a network task (just a simple example):
import PhotoScan, sys
args = sys.argv
label = args[1] #the very first argument is the script path
doc = PhotoScan.app.document
chunk = doc.chunk
chunk.label = label