python code:
def fun(a,b):
c=a+b
return c
sed command to add doc string:
sed -i '/^def/a \\t """\n\tSummary:\n\t-------\n\tParameters:\n\t----------\n\tReturn:\n\t------\n\t"""' filename
python code after sed command
def fun(a,b):
"""
Summary:
-------
Parameters:
-----------
Return:
-------
"""
c=a+b
return c
Now the problem is added doc-string looks correct in vim editor but on running a code execution hits indentation error. Can anyone explain what wrong is happening here?