I have a directory I\'d like to print out with a trailing slash: my_path = pathlib.Path(\'abc/def\')
my_path = pathlib.Path(\'abc/def\')
Is there a nicer way of doing this than os.path.j
os.path.j
You could also use:
os.path.normpath(str(my_path)) + os.sep
I would say it is down to preference rather than being "nicer"