2010-02-10, 00:48
I'm trying to create my first python script that runs the command mount -a on my ubuntu xbmc installation. The code that a am using is:
It runs the script without a error. But as xbmc runs as a user, i'm guessing it's not allowed to run the mount command.
So i hope someone can help me with these questions.
1. How do you run a command with elevated rights? Like sudo..?
2. Is it possible to log/write the response of a os.system() command to for example syslog?
thx!
Code:
import xbmc,xbmcgui
import subprocess,os
os.system("mount -a")
It runs the script without a error. But as xbmc runs as a user, i'm guessing it's not allowed to run the mount command.
So i hope someone can help me with these questions.
1. How do you run a command with elevated rights? Like sudo..?
2. Is it possible to log/write the response of a os.system() command to for example syslog?
thx!