title: Subprocess Variables
body: <pre><code>  1 import subprocess
    2 raw = raw_input("Filename:").lower()
    3 ip = raw_input("Host:").lower()
    4 cmd = subprocess.call("tcpdump -c5 -vvv -w" + " raw " + " ip ",shell=True)
  </code></pre>
  
  <p>So this is my script. I everything works besides one key objective, using the raw input.
  It allows me to input anything i want, but when it goes to saving the file or using an ip/host doe doesn't actually do anything.
  Sure it gives me the packets, but from the localhost not the host i type in.</p>
  
  <p>how i know this isn't working is cause my first raw input is the filename, so i put in test, when i look in the folder were my script is, it produces a file called "raw" meaning, its not actually taking my input only using whats inside my "X"...</p>
  
  <p>So i make a few chances to come to this:</p>
  
  <pre><code>  1 import subprocess
    2 raw = raw_input("Filename:").lower()
    3 ip = raw_input("Host:").lower()
    4 cmd = subprocess.call("tcpdump -c5 -vvv -w" + raw + "host" + ip,shell=True)
  </code></pre>
  
  <p>Which is great because it actually calls for the -w but it saves it now as rawhostip instead of "raw"s input. 
  for reference this is what the command looks like in the terminal:</p>
  
  <pre><code>tcpdump -c5 -vvv -w savename host wiki2
  </code></pre>
  
  <p>the only two variabls are savename and wiki2 the rest are needed for the command to work.</p>
  
  <p>with this script i get this error:</p>
  
  <pre><code>import subprocess
  raw = raw_input("Filename:").lower()
  ip = raw_input("Host:").lower()
  cmd = subprocess.call("tcpdump -c5 -vvv -w" + raw, "host" + ip,shell=True)
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "te.py", line 4, in &lt;module&gt;
      cmd = subprocess.call("tcpdump -c5 -vvv -w" + raw, "host" + ip,shell=True)
    File "/usr/lib/python2.6/subprocess.py", line 480, in call
      return Popen(*popenargs, **kwargs).wait()
    File "/usr/lib/python2.6/subprocess.py", line 583, in __init__
      raise TypeError("bufsize must be an integer")
  TypeError: bufsize must be an integer
  </code></pre>
  
  <p>I am at a lost. Any help will be great, yes I know look at subprocess's doc's on site:X, I have I need a human to teach me, I don't understand what I am reading.</p>
  
  <p>My question is how do I work with these variables.</p>