2

I have yhe following code at the beginning of a script :

#!/usr/bin/env python3  
"""  
NAME: renPhotosFromDir dir(s)..

DESCRIPTION: Rename jpg, jpeg or mov file from the directory using its name followed by a number

AUTEUR :
    CHAUVIERE Jean-Raymond

DATE: 13 Janvier 2019

COPYRIGHT:
     visit http://www.gnu.org/licenses/licenses.html#GPL

"""

If i run

renPhotosFromDir.py --help

I get the following result :

usage: NVrenPhotosFromDir.py [-h] [directories ...]

NAME: renPhotosFromDir dir(s)... DESCRIPTION: Rename jpg, jpeg or mov file from the directory using its name followed by a number AUTEUR : CHAUVIERE Jean-Raymond DATE: 13 Janvier 2019 COPYRIGHT: visit http://www.gnu.org/licenses/licenses.html#GPL

positional arguments:   directories  liste de répertoires

optional arguments:   -h, --help   show this help message and exit

How I can preserve newlines from the docstring ?

Naetmul
  • 14,544
  • 8
  • 57
  • 81
vvk
  • 21
  • 2
  • Do you still have the issue if you add `\n` to the end of each line? I know it's not an answer, I'm just curious. – Roy Cohen May 01 '21 at 14:25
  • yes, the solution is explained there : https://stackoverflow.com/questions/3853722/how-to-insert-newlines-on-argparse-help-text – vvk May 02 '21 at 17:22

0 Answers0