Nov-12-2022, 03:18 AM
(This post was last modified: Nov-12-2022, 03:18 AM by deanhystad.)
All str objects are raw. Only string literals are not raw. A string command line argument is raw.
Can you demonstrate why you think you need this: Path(r{source_path})
import sys print("Literal") print("C:\\name\things\really\badly.txt") print("\nCommand Line") print(sys.argv[1])
Output:>>> python test.py "C:\\name\things\really\badly.txt"
Literal
ealladly.txts
Command Line
C:\\name\things\really\badly.txt
No escape sequence substitution because the command line argument is not a Python str literal.Can you demonstrate why you think you need this: Path(r{source_path})