On 11/6/2016 6:48 AM, SS wrote:

cmd="dig @4.2.2.2 %s ns +short", % (domname)

does not work.

No kidding. ', %' is a syntax error. The , makes a tuple, the % after string does interpolation. You obviously want the latter so omit the ,.

The traceback should have pointed you to where the code became invalid.

>>> cmd="dig @4.2.2.2 %s ns +short", % (domname)
  File "<stdin>", line 1
    cmd="dig @4.2.2.2 %s ns +short", % (domname)
                                     ^
This mean that % is not valid GIVEN WHAT HAS COME BEFORE being treated as correct. The , could have been correct, so Python cannot know it is incorrect here.

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to