title: Passing Windows cmd to the Python subprocess
body: <p>I'm trying to execute aws cli command using Pyton's subprocess</p>
  <p>windows cmd:</p>
  <pre><code>aws --profile some_profile --region some_region ec2 describe-instances --filters Name=tag:some_tag,Values=some_value --query &quot;Reservations[*].Instances[*].{AvailabilityZone:Placement.AvailabilityZone,Status:State.Name,Name:Tags[?Key=='Name']|[0].Value}&quot; --output=table
  </code></pre>
  <p>and that's how I try to do it:</p>
  <pre><code>profile = &quot;some_profile&quot;
  region = &quot;some_region&quot;
  ec2_filters = &quot;Name=tag:some_tag,Values=some_value&quot;
  ec2_query = &quot;Reservations[*].Instances[*].{AvailabilityZone:Placement.AvailabilityZone,Status:State.Name,Name:Tags[?Key=='Name']|[0].Value}&quot;
  ec2_output_type = &quot;table&quot;
  
  proc = subprocess.Popen([&quot;aws&quot;, &quot;--profile&quot;, profile, &quot;--region&quot;, region, &quot;ec2&quot;, &quot;describe-instances&quot;, &quot;--filters&quot;, ec2_filters, &quot;--query&quot;, ec2_query, &quot;--output&quot;, ec2_output_type], stdout=subprocess.PIPE, shell=True)
  </code></pre>
  <p>This is the error message:</p>
  <blockquote>
  <p>'[0].Value}' is not recognized as an internal or external command,
  operable program or batch file.</p>
  </blockquote>