title: Why I got "sh: 1: Syntax error: Unterminated quoted string" when I run my Python program?
body: <p>I want to count how many lines of code I have written.</p>
  
  <p>Here is the Python code:</p>
  
  <pre><code>import os
  import sys
  
  EXT = ['.c','.cpp','.java','.py']
  
  def main():
      l = []
      if os.path.isdir(sys.argv[1]):
          for root, dirs, files in os.walk(sys.argv[1]):
              l.extend([os.path.join(root, name) for name in files])
      else:
          l.append(sys.argv[1])
  
      params = ["'"+p+"'" for p in l if os.path.splitext(p)[1] in EXT]
  
      result = os.popen("wc -l %s "%" ".join(params)).read()
      print result
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p>Before this, it was running as expected. But today, it give me this error:</p>
  
  <pre><code>sh: 1: Syntax error: Unterminated quoted string
  </code></pre>
  
  <p>I don't know what happened.</p>