1

How can I run a Python script which, upon execution, brings up a dialog prompting the user for his root password - so that the script is run as root, being able to make changes to files within the /... directories?
I'm using Gtk-2

2
  • @JacobVlijm Not installed by default? even in Ubuntu and its derivatives? It's installed on my system...
    – TellMeWhy
    Jun 27, 2015 at 18:11
  • 1
    Try my answer, I don't care for the points, but this is hurting my eyes. Jun 27, 2015 at 18:24

1 Answer 1

3

Take a look at http://www.cyberciti.biz/open-source/command-line-hacks/linux-run-command-as-different-user/ then just write a sh script which you chmod +x so that you can execute it then just use the script to launch the other script.

1
  • So make an executable script containing gksu -u root '<script>'?
    – TellMeWhy
    Jun 27, 2015 at 17:55

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.