I while ago, when using Popen I seem to remember there was an issue with
the 'shell' part of the command. It had to be there for it to work and it
had to be shell=True, I believe (though it can equally be shell=False, my
memory...).
Try it, maybe it will help.

R




Ron Ganbar
email: [email protected]
tel: +44 (0)7968 007 309 [UK]
     +972 (0)54 255 9765 [Israel]
url: http://ronganbar.wordpress.com/


On Mon, Sep 9, 2013 at 3:42 PM, Harrison Ly <[email protected]>wrote:

>  Hi All,
>
>
> I'm trying to send a footage file to compressor on osx via the terminal
> from Nuke. I've got the command line working which does the job if I
> manually copy and paste the output into terminal. When I use 'Popen' with
> 'cmd' it returns an error. Anyone can direct me the right way?
>
>
> import os
>
> import subprocess
>
>
> compressorPath = '/Applications/Compressor.app/Contents/MacOS/Compressor'
>
> a=nuke.selectedNode()
>
> b=a['file'].value()
>
> u=os.path.split(b) [0]
>
> u = os.path.normpath (u)
>
> oldName = os.path.split(b) [1]
>
> oldName = os.path.splitext(oldName) [0]
>
> fileType= a['file_type'].value()
>
> newName = '%s/%s_4444HQ.%s' % (u,oldName, fileType)
>
>
> cmd = '%s -clustername \'This Computer\' -jobpath %s -settingpath
> /Applications/Compressor.app/Contents/Resources/English.lproj/Formats/QuickTime/Apple\
> ProRes\ 422\ \(HQ\).setting -destinationpath %s' % (compressorPath,
> b,newName)
>
>
> from subprocess import Popen, PIPE, STDOUT
>
> p = Popen([cmd], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
>
> output = p.communicate(input='ls')
>
> print(output)
>
>
> Harrison Ly
>
> www.harrisonly.co.uk
> [email protected]
> +44 (0)7784111844
>
>
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to