I study how to document my code.
So, I prepared a file docstrings.py and placed it in a directory.
Now I would like to have a look at what I documented. In other words I want to type
help(docstrings.square) and get the documentation on square function in my module.
>>> import sys
>>> sys.path.append("C:\Users\Michael\PycharmProjects\Docstrings")
Result:
SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-4: truncated \UXXXXXXXX escape
What’s wrong?
Backslashes have to be doubled in string literals:
Unless you use a raw string: