简体   繁体   English

以管理员权限运行python应用程序

[英]Run python application with admin privileges

Working on windows platform, I have a python application which once invoked, remembers its state and resumes in case of system crash or reboot. 在Windows平台上工作时,我有一个python应用程序,该应用程序一旦被调用,就会记住其状态,并在系统崩溃或重新启动时恢复。 The application actually runs some other executables or in technological terms is of type framework. 该应用程序实际上运行其他一些可执行文件,或者从技术角度来说是类型框架。 The typical scenario where the executable need to run with admin mode passes for first time but fails after resuming from crash or reboot. 可执行文件需要以管理模式运行的典型场景是第一次通过,但是在崩溃或重新启动后恢复失败。 What I believe is I need to invoke the resumed application with admin mode. 我相信我需要以admin模式调用恢复的应用程序。 In what way this could be achieved, Thanks in advance! 可以通过什么方式实现,请先谢谢!

For Linux, see documentation on upstart (for Ubuntu) or service (for RedHat). 对于Linux,请参阅有关upstart (对于Ubuntu)或service (对于RedHat)的文档。 The write a start-up script to start your Python script with appropriate rights. 编写启动脚本以适当的权限启动Python脚本。 You can also configure it to be restarted if it crashes. 您也可以将其配置为在崩溃时重新启动。

Windows has a similar facility for start-up programs, where you can register your program to start. Windows具有启动程序的类似功能,您可以在其中注册程序以启动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM