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

  • @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


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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .