[docs] [issue11479] Add discussion of trailing slash in raw string to tutorial
report at bugs.python.org
Sun Mar 13 13:36:03 CET 2011
Graham Wideman <initcontact at grahamwideman.com> added the comment:
Eli: Excellent and thoughtful point. This would indeed be exactly the place to suggest os.path.join as an alternative.
In addition, there are still occasions where one needs to form a string with trailing backslash. Two examples:
1. When writing the string specifying root directory: r'C:\ '[:-1]
2. Using python to prepare command lines to run other command line programs, where an argument may require a final backslash to explicitly specify a target directory (as opposed to a file).
Python tracker <report at bugs.python.org>
More information about the docs