<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div><br></div><div><br>On 6 Jan 2018, at 15:33, Shriramana Sharma <<a href="mailto:samjnaa@gmail.com">samjnaa@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><span>On 1/6/18, Barry <<a href="mailto:barry@barrys-emacs.org">barry@barrys-emacs.org</a>> wrote:</span><br><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>This is not pyqt problem.</span><br></blockquote><span></span><br><span>Never said it was. Just wanted to know what approach PyQt users employ</span><br><span>for this problem.</span><br><span></span><br><blockquote type="cite"><span>But short answer is you cannot change current</span><br></blockquote><blockquote type="cite"><span>process privs.</span><br></blockquote><span></span><br><span>OK.</span><br><span></span><br><blockquote type="cite"><span>Use subprocess to spawn a sudo command line. You need to set sudo askpass to</span><br></blockquote><blockquote type="cite"><span>allow the sudo password to be entered.</span><br></blockquote><span></span><br><span>To avoid external dependency on an askpass program (and there only</span><br><span>seem to be "ssh-askpass" programs, none for generic sudo), I suppose I</span><br><span>can just get the password from an input dialog and then pass it to</span><br><span>`sudo -S`?</span><br><span></span><br></div></blockquote><div><br></div><div>Have a look at the scm workbench code that solves a related problem with git.</div><div>Look at the small program that used the askpass interface to call back into the gui to get the username and password that is needed.</div><div><br></div><div><a href="https://github.com/barry-scott/scm-workbench">https://github.com/barry-scott/scm-workbench</a></div><div><br></div><div>Barry</div><div><br></div><blockquote type="cite"><div><span>-- </span><br><span>Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा 𑀰𑁆𑀭𑀻𑀭𑀫𑀡𑀰𑀭𑁆𑀫𑀸</span><br><span></span><br></div></blockquote></body></html>