1

I keep getting this error when running a python script

sudo python net-creds.py
  File "net-creds.py", line 75
    ipr = Popen([‘/usr/local/bin/ip’, 'route'], stdout=PIPE, stderr=DN)
                 ^
SyntaxError: invalid syntax
1
  • what are you doing with the output? If you want to store the output you can use check_output: c = check_output(["ip","route"]) Commented Apr 14, 2015 at 18:55

1 Answer 1

2

You are using " ` " instead of '.So try this

ipr = Popen(['/usr/local/bin/ip', 'route'], stdout=PIPE, stderr=DN)
Sign up to request clarification or add additional context in comments.

1 Comment

To clarify: the invalid version has "smart quotes." The valid version has ordinary "dumb quotes."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.