I am writing a Python script to run on Raspbian that opens a webpage using webbrowser.open() and also writes to the GPIO pins to control some external LEDs.

The problem is that writing the GPIO pins requires me to run the script using sudo however I think the system does not allow opening of websites with this secruity permission.

How can I write my script so that I can do both actions?

  • Perhaps look through some questions. See the sort of things you will have to add to your question to make it answerable.
    – joan
    Jun 17 at 15:18
  • 1
    If your (unlisted) program "needs" sudo you are doing something wrong.
    – Milliways
    Jun 17 at 22:44


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.