MicheleCotrufo/pdf2doi

Possible optimization for main.py

Pathos315 opened this issue · 1 comments

Currently, lines 425 to 428 in main read:

    for result in results:
        if result['identifier']:
            print('{:<15s} {:<40s} {:<10s}\n'.format(result['identifier_type'], result['identifier'],result['path']) ) 

    return

I suspect this could be improved/updated with an f-string:

    for result in results:
        if result['identifier']:
            print(f'{result['identifier_type']}, {result['identifier'], {result['path']} \n')

    return

Thanks for this suggestion! The main reason why I use the {:<15s} {:<40s} {:<10s} part is to make sure that the correct tabulation spaces are kept, and to give an overall more "tabular" look to the output