title: Python optparse and spaces in an argument
body: <p>When using optparse i want to get the whole string after an option, but I only get part of it up to the first space.</p>
  
  <p>e.g.:</p>
  
  <pre><code>python myprog.py --executable python someOtherProg.py
  </code></pre>
  
  <p>What I get in 'executable' is just 'python'. </p>
  
  <p>Is it possible to parse such lines using optparse or do you have to use argparse to do it?</p>
  
  <p>€: I have already tried enclosing it in "s. But after digging further into the code I found out that the subprocess invocation can't handle the argument.</p>
  
  <p>The string with the commandline gets crammed into a list 'args'.</p>
  
  <pre><code>args = [self.getExecutable()] + self.getArgs().split()
  </code></pre>
  
  <p>It's like </p>
  
  <pre><code>"[python D:\\\workspace\\\myprog\\\src\\\myprog.py]"
  </code></pre>
  
  <p>That gives me the System can't find file exception. When I use </p>
  
  <pre><code>args[0]
  </code></pre>
  
  <p>it works. But I loose the arguments to the executable. </p>
  
  <p>The subprocess module builds a cmdline from a list if it does not get a string in the first place, so I can't explain that behavior at the moment.</p>