How do I make all the docstring using triple double quotes instead of triple single quotes?
<p>I have a long source code in python, and many functions are documented with <code>'''xxx'''</code>, How do I replace them with <code>"""xxx"""</code> quickly? in any text editor ?  pycharm / sublime </p>

<pre><code>def my_func():
    '''
    yeah a doc string
    '''
    pass
</code></pre>

<p>desired result:</p>

<pre><code>def my_func():
    """
    yeah a doc string
    """
    pass
</code></pre>

<p>edit:
Found the solution in pycharm ( or every other text editor)
search for 
<code>'''(\n.*\n\s*)'''\n</code>
and replace with
<code>"""$1"""\n</code></p>

<p>ps: I can not just do a simple search for <code>'''</code>,and replace it with <code>"""</code>, because in the code multi line strings are everywhere, not just in the docstring.</p>

<pre><code>python -c "import sys;with open(sys.argv[1],'rb') as f: tmp = f.read();with open(sys.argv[1],'wb') as f:f.write(tmp.replace(\"'''\",'\"\"\"')"
</code></pre>

python pycharm sublimetext docstring