Basically, just use "os.system(str)". For example:
import os cmd = 'ls' os.system(cmd)
However, when we need to be root, e.g., running "sudo apt-get update", troubles come out, since a UI application started in N800 menu gives you no chance to input a password for background command "sudo" (in fact, we don't have the default password for maemo neither).
One way of gaining root permission in XTerminal is simply run "sudo gainroot" after install "becomeroot" package. But it does not work in UI application because an application and the command line it starts run in different processes.
To solve the problem, we need to add a line to file "postinst.ex" in debian directry, and change its name into "postinst".
Line 4 is what we add. It makes the script "run-standalone.sh" which starts all applications run well without being asked any passwords even "sudo" executed.
case "$1" in configure) echo -e "\n"user ALL = NOPASSWD: /usr/bin/run-standalone.sh >> /etc/sudoers ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac
Actually, whatever we want to be executed can be added into the file "postinst", and then it will run during installation. Problems that cannot be worked out by codes may be solved easily here, like modifying files as root, etc.