I am currently running a few modules from the command line. I came across this oddest of issues. When I run the following script via the following command line: python welcome.py:
"""
welcome.py
Desktop\socket_scripts\welcome.py
"""
print('Welcome to the Python forum!')
I get the following warning:
SyntaxWarning: invalid escape sequence '\s'
Apparently it reads the comments at the top of the module. But if they’re comments, why would it care if there are backspaces? Shouldn’t it ignore the comment section?
File "C:\Desktop\socket_scripts\welcome.py", line 5
{__Desktop\socket_scripts\welcome.py__}
^
SyntaxError: unexpected character after line continuation character
Yes, that works. But then that defeats the whole purpose since I want to include the pathname along with the module name. These are module comments after all with information stating where the module is located.
Sure. It’s just a suggestion. You’re the one maintaining it. I just wondered if using Python based doc tools that import the code base, whether this might be more robust and result in less work.