Reputation: 966
in python 2.7 i try this code to get data from Deadline software. Its return some data from server...
import subprocess
path = 'C:/Program Files/Thinkbox/Deadline7/bin/'
p1 = subprocess.Popen([path + 'deadlinecommand.exe', 'pools'], stdout=subprocess.PIPE)
p1.communicate()
and see result:
('none\r\npool_01\r\npool_02\r\npool_03\r\npool_04\r\npool_05\r\npoolhalf\r\n', None)
but when i copy that code to python in maya 2014 i get error:
p1 = subprocess.Popen(['path + 'deadlinecommand.exe', 'pools'], stdout=subprocess.PIPE)
# Error: WindowsError: file C:\PROGRA~1\Autodesk\maya2014\bin\python27.zip\subprocess.py line 826: 6 #
run this exe file - is the only option dedline communication. but it pays to stdout data and how it is necessary to pull out. subprocess options except I have not found, but if there are other options will be glad to try them
anyone else encountered this problem? strange that in pure Python 2.7 running in windows all works, and there is no Maya 2014
i use:
Windows 7 + Python 2.7.9
Maya 2014 (Python 2.7.3)
Upvotes: 3
Views: 3742
Reputation: 401
I was just trying something similar couple of days back, connecting to Deadline via the command line submitter and getting
# File "C:\Program Files\Autodesk\Maya2013\bin\python26.zip\subprocess.py", line 786, in _make_inheritable
# WindowsError: [Error 6] The handle is invalid
error in Maya 2013.5. One workaround found here which does fix this issue is to pipe all the handles
p1 = subprocess.Popen([path + 'deadlinecommand.exe', 'pools'], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
Hope it helps.
Upvotes: 4