Table of Contents

Deadline Basic

Python Scripting for Deadline

Get Submission Info

# get deadline cmd exe path
dl_cmd = os.path.normpath( os.path.join(os.environ['DEADLINE_PATH'], 'deadlinecommand.exe') )
 
# use deadline cmd to get deadline system info
cmd = r'"{0}" -JSON -GetSubmissionInfo Pools Groups MaxPriority TaskLimit UserHomeDir RepoDir:submission/Maya/Main RepoDir:submission/Integration/Main'.format(dl_cmd)
 
# note: the original mel code, put " 2> nul" at the end of the cmd, which means no err output, and only 1st output/the result to the string. 
# so they don't need 2 variable like bellow to catch the return values.
 
info=subprocess.Popen(cmd,stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = info.communicate()
exitcode = info.returncode
 
# read data
import json
dl_data = json.loads(out)
deadlineSubmissionInfo=dl_data['result']
 
# pool list
pool_list = deadlineSubmissionInfo['Pools']