title: remove python multiline comments and do not remove string
body: <p>the question: I want to use shell scripts to remove:</p>
  
  <pre><code>"""
  111
  222
  """
  or 
  '''
  111
  222
  '''
  </code></pre>
  
  <p>but do not remove</p>
  
  <pre><code>s = """
  111
  222
  """
  </code></pre>
  
  <p>I test the following ways:</p>
  
  <pre><code>find -name *.py | xargs -i  sed -i "/^\s*\"\"\".*\"\"\"$/d" {}
  
  find -name *.py | xargs -i sed -i '/"""/,/"""/d' {}
  </code></pre>
  
  <p>but i have no idea about </p>
  
  <pre><code>s = """
  111
  222
  """
  </code></pre>
  
  <p>please help</p>
  
  <p>the test code like this,thanks 
  >
      """
      template
      class Foo {
      public:
      virtual int Bar();
      };
      """</p>
  
  <pre><code>source = """
  class Foo {
  public:
  virtual int Bar();
  };
  """
  
  """
  template&lt;class T&gt;
  class Foo {
  public:
  virtual int Bar();
  };
  """
  
  source = """
  class Foo {
  public:
  virtual void Bar(bool flag) const;
  };
  """
  
  source = """
  class Foo {
  public:
  virtual int Bar(void);
  };
  """
  </code></pre>
  
  <p>uptonow:
  the 
  """
  aaa
  """
  and the
  ="""
  bbb
  """
  have been test ok
  function delete_multiline_comments</p>
  
  <pre><code>function delete_multiline_comments
          grep -n '\"\"\"' gmock_class_test.py | sed  '/=/,+1d' &gt;a.txt
  
          line=$(wc -l a.txt| awk '{print $1}')
  
          for (( i=0;i&lt;$line/2;i++ ))
          do
                  second=`tail -1 a.txt | tr -cd "[0-9]"`
                  sed -i '$d' a.txt
  
                  first=`tail -1 a.txt | tr -cd "[0-9]"`
                  sed -i '$d' a.txt
  
                  sed -i "${first},${second}d" gmock_class_test.py
          done
  end
  </code></pre>
  
  <p>the following line used to remove """XXXX""" and '''XXX''' line</p>
  
  <pre><code>sed -ie "/'''.*'''/d" 
  sed -i  "/^\s*\"\"\".*\"\"\"$/d" 
  </code></pre>