I am writing a python/Qt application which needs to perform disk mounting. Hence it needs root permissions. Is there any way that I could make the script acquire root permissions using a popup for password, like gparted does? I know I can detect within the script, if it has been run with sudo or not, with something like this (for example in bash):
if [[ $(id -u) -ne 0 ]];
But after this, how do I ask for the password and acquire root permissions at runtime?
Thanks.