If you use triple quotes, the newlines don't need to be escaped.

'''
cmd=""
words[0]=""
...
'''