Ask Your Question

Running a script as sudo from Wing IDE

asked 2019-01-05 12:08:00 -0600

GeertVc gravatar image

updated 2019-03-13 10:26:35 -0600

Hi, I have Python code that uses the bluetooth module.  One of the bluetooth calls I'm doing needs sudo permission (advertise_service()).

When running the script on the command line on a RPi, I simply do this: sudo python3 <name_of_script>.  That works perfect.

However, if I want to debug that script from within Wing IDE (remotely), how can I start the debug session of that script as sudo?



edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-01-05 17:08:00 -0600

updated 2019-03-06 22:25:07 -0600

Wingware Admin gravatar image

One way would be to use wingdbstub to initiate debug as described in

Another way would be to initiate debug with wingdb as described in (this method doesn't require adding an import to your code).  You would add sudo before wingdb.Neither of these starts the debug process from within Wing, but you could set up an OS Command to start the process in combination with one of the above methods.

It would also be possible to set up a script that invokes sudo python and passes in all args and set that as Python Executable in Wing, but this would only work if sudo doesn't require typing in a password.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2019-01-05 12:08:00 -0600

Seen: 783 times

Last updated: Mar 06 '19