Home > other > How will the python Linux commands with permission?
How will the python Linux commands with permission?
Time:09-20
Recently to Python to implement some shell command calls, in order to cooperate to do a UI, the final packaging generated APP, intuitive easy to use, but in dealing with the root file, unable to perform, such as several times to remove the system/Library directory of one type of file, how to realize don't every time permissions, only when running for the first time give password authorization will perform follow-up multiple administrator privileges command?
Is not authorized to perform a single command, must be authorized by the APP to be executed for the first time after the command can execute multiple administrator privileges, like we usually installed APP,
Beginning and end of the great god, and have some ways to achieve this?
CodePudding user response:
1 save password, execute every time sodu
2 call first so root, and then execute root command