[PyQt] Asking for temporary privilege elevation

Shriramana Sharma samjnaa at gmail.com
Sat Jan 6 12:11:57 GMT 2018


Hello. I'm writing a PyQt5 program that can do its basic function
without superuser permission, but for one function (modifying a system
configuration file under /usr/) it needs superuser permission.

I checked on StackOverflow but though there is talk about using
SUDO_ASKPASS and subprocess.run or such, I didn't find any clear
specific methods of asking for privilege elevation of the *current*
process so I can directly open and modifying such files using Python
file IO.

Please advise. Thank you!

-- 
Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा 𑀰𑁆𑀭𑀻𑀭𑀫𑀡𑀰𑀭𑁆𑀫𑀸


More information about the PyQt mailing list