PDA

View Full Version : Python script test run as root from IDE



unclecameron
June 2nd, 2008, 09:05 PM
I'm logged in as a regular user running SCITE Python IDE and the script I'm writing needs to run as root, is there code I can add in the script to sudo and run as root? I don't want to login as root and run the SCITE IDE. Also I could open another terminal as root and just run it, but that defeats the purpose of the simulator in the IDE.

LaRoza
June 2nd, 2008, 09:22 PM
I'm logged in as a regular user running SCITE Python IDE and the script I'm writing needs to run as root, is there code I can add in the script to sudo and run as root? I don't want to login as root and run the SCITE IDE. Also I could open another terminal as root and just run it, but that defeats the purpose of the simulator in the IDE.

Remember all the warnings that go with running as root

Can you try running the IDE as root? (press Alt + F2 and type "gksu scite" or whatever the IDE is called)

unclecameron
June 3rd, 2008, 04:46 PM
when I attempt to run it as root I get an error

(scite:5602): Gtk-WARNING **: cannot open display: :0
which is a similar error I got trying to run OpenKomodo and Eclipse as root wile logged in as a regular user.

unclecameron
June 26th, 2008, 05:54 PM
well, I "fixed" it by logging in as root, since my IDE SCITE will run the python app, but since it needs to run os.system("runmyrootbashscript") then the IDE (which is gui-based) needs to run as root. Anyone got any workarounds for this?

geirha
June 26th, 2008, 06:12 PM
os.system("gksudo runmyrootbashscript")