0

This codeline gets inproperly interpeted because of the "". How to fix that? subprocess is imported.

subprocess.run("netsh wlan connect name="WLAN Name"", shell=True)

Thanks for your help!

3
  • Tru 'netsh wlan connect name="WLAN Name"' Commented Apr 27, 2022 at 7:37
  • 2
    That's not a problem of subprocess, but rather of the string syntax in Python, I suggest. Commented Apr 27, 2022 at 7:38
  • Read about Strings in one of the first chapters of the Python tutorial. Commented Apr 27, 2022 at 7:44

1 Answer 1

1

You can use single quotes here subprocess.run('netsh wlan connect name="WLAN Name"', shell=True). The double quotes can also be used but you will have to use an escape with it.

Sign up to request clarification or add additional context in comments.

Comments

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.