我想自動啟動 XAMPP 控制面板的 Apache 和 MySql,而不必讓應用程式的用戶知道。使用 Python 2.7
這些按鈕在下面突出顯示。
提前致謝!

uj5u.com熱心網友回復:
以管理員身份打開 Windows 命令提示符
鍵入“net start”以查看正在運行的服務視窗串列。
找到服務的名稱,例如“Apache2.4”
撰寫 python 命令來啟動/停止/重啟服務....
import win32serviceutil
win32serviceutil.StartService('Apache2.4')
win32serviceutil.RestartService('Apache2.4')
win32serviceutil.StopService('Apache2.4')
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/359234.html
標籤:mysql python-2.7 阿帕奇 xampp 杰通
