The trailing "\r\n" is missing from the command. I prefer the string interpolation approach, did you change that because it doesn't work in Python 3?