title: Porting 'sh 1.11'-based code to Windows
body: <p>All signs seem to indicate that my script is fully operational within a Linux environment and as far as I can tell, the only thing keeping it from working in Windows is my usage of <a href="https://pypi.python.org/pypi/sh" rel="nofollow"><strong>sh</strong></a>, which is pretty straightforward:</p>
  
  <pre><code>from sh import convert
  
  convert(inputfile, '-resize', r, '-quality', q, '-strip', outputfile)
  </code></pre>
  
  <p>This translates to a bash line:</p>
  
  <pre><code>convert image.jpg -resize 350x350 -quality 80 -strip ./small/export.jpg
  </code></pre>
  
  <p>where the <code>r</code> and <code>q</code> variables are any given resolution or quality.</p>
  
  <hr>
  
  <p>Running this in Windows of course raises an error because 'sh' is completely non-functional in Windows :( I tried replacing 'sh' with the deprecated <a href="https://pypi.python.org/pypi/pbs" rel="nofollow"><strong>pbs</strong></a>, but am not having any luck. This is what I've got so far:</p>
  
  <pre><code>import pbs
  
  pbs.convert('-resize', r, '-quality', q, '-strip', inputfile, outputfile)
  </code></pre>
  
  <p>The error being raised is:</p>
  
  <pre><code>  File "C:\Python27\lib\site-packages\pbs.py", line 265, in _create
      if not path: raise CommandNotFound(program)
  pbs.CommandNotFound: convert
  </code></pre>
  
  <hr>
  
  <p><strong>Question:</strong></p>
  
  <blockquote>
    <p><strong>How do I successfully pass these ImageMagick commands from my script while in a Windows environment?</strong></p>
  </blockquote>