吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 2791|回复: 23
收起左侧

[Windows] 美化版 关机重起V2.0

  [复制链接]
xiaom1128 发表于 2025-3-17 10:14
不废话直接上图:  
  
自用2年无BUG


下载地址:

https://wwpy.lanzoue.com/iEazA2qt57te
密码:e3ym

软件大小

软件大小

软件界面

软件界面

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

liuyang207 发表于 2025-4-7 15:56
这种小功能的软件,用deepseek一句话就生成好了。只是这破python打包出来有点大,可能是我要它把界面整得漂亮点的原因。

https://www.alipan.com/s/31q1zV46Wza

[Python] 纯文本查看 复制代码
001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
041
042
043
044
045
046
047
048
049
050
051
052
053
054
055
056
057
058
059
060
061
062
063
064
065
066
067
068
069
070
071
072
073
074
075
076
077
078
079
080
081
082
083
084
085
086
087
088
089
090
091
092
093
094
095
096
097
098
099
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton, QVBoxLayout, QWidget, QLabel, QTimeEdit, QMessageBox
from PyQt5.QtCore import QTime, QTimer
import os
import subprocess
 
class SystemControlTool(QMainWindow):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("系统控制工具")
        self.setGeometry(100, 100, 300, 400)
        self.setStyleSheet("""
            QMainWindow {
                background-color: #2c3e50;
                color: #ecf0f1;
            }
            QPushButton {
                background-color: #3498db;
                color: white;
                border: none;
                padding: 10px;
                font-size: 16px;
                border-radius: 5px;
                min-width: 200px;
            }
            QPushButton:hover {
                background-color: #2980b9;
            }
            QTimeEdit {
                background-color: #34495e;
                color: #ecf0f1;
                border: 1px solid #7f8c8d;
                padding: 5px;
                border-radius: 3px;
            }
            QLabel {
                font-size: 14px;
                margin-bottom: 5px;
            }
        """)
 
        self.initUI()
 
    def initUI(self):
        central_widget = QWidget()
        self.setCentralWidget(central_widget)
        layout = QVBoxLayout()
 
        # 关机按钮
        shutdown_btn = QPushButton("关机")
        shutdown_btn.clicked.connect(self.shutdown)
        layout.addWidget(shutdown_btn)
 
        # 重启按钮
        restart_btn = QPushButton("重启")
        restart_btn.clicked.connect(self.restart)
        layout.addWidget(restart_btn)
 
        # 休眠按钮
        sleep_btn = QPushButton("休眠")
        sleep_btn.clicked.connect(self.sleep)
        layout.addWidget(sleep_btn)
 
        # 定时关机
        layout.addWidget(QLabel("定时关机:"))
        self.time_edit = QTimeEdit()
        self.time_edit.setDisplayFormat("HH:mm")
        self.time_edit.setTime(QTime.currentTime())
        layout.addWidget(self.time_edit)
 
        schedule_btn = QPushButton("设置定时关机")
        schedule_btn.clicked.connect(self.schedule_shutdown)
        layout.addWidget(schedule_btn)
 
        central_widget.setLayout(layout)
 
    def shutdown(self):
        reply = QMessageBox.question(self, '确认', '确定要关机吗?',
                                    QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
        if reply == QMessageBox.Yes:
            os.system("shutdown /s /t 1")
 
    def restart(self):
        reply = QMessageBox.question(self, '确认', '确定要重启吗?',
                                    QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
        if reply == QMessageBox.Yes:
            os.system("shutdown /r /t 1")
 
    def sleep(self):
        reply = QMessageBox.question(self, '确认', '确定要休眠吗?',
                                    QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
        if reply == QMessageBox.Yes:
            os.system("rundll32.exe powrprof.dll,SetSuspendState 0,1,0")
 
    def schedule_shutdown(self):
        current_time = QTime.currentTime()
        shutdown_time = self.time_edit.time()
         
        if shutdown_time <= current_time:
            QMessageBox.warning(self, '错误', '请设置一个未来的时间')
            return
             
        seconds = current_time.secsTo(shutdown_time)
        reply = QMessageBox.question(self, '确认',
                                    f'将在{shutdown_time.toString("HH:mm")}关机,确认吗?',
                                    QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
        if reply == QMessageBox.Yes:
            os.system(f"shutdown /s /t {seconds}")
            QMessageBox.information(self, '成功', f'已设置定时关机: {shutdown_time.toString("HH:mm")}')
 
if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = SystemControlTool()
    window.show()
    sys.exit(app.exec_())
 楼主| xiaom1128 发表于 2025-3-19 16:39
之所以推出这个软件,本人是一名有时需要远程电脑桌面的作者,有好几次想重起和关机,发现有时远程界面操作不了,用命令又太烦。后发现了此简单明了之软件,所以独乐乐,不如众乐乐
yueyegufeng 发表于 2025-3-17 19:36
我还以为是可以设定时间自动关机重启呢,如果跟手机一样就好了
hz123 发表于 2025-3-17 20:20
被火绒直接杀了
linlizi 发表于 2025-3-17 21:38
不是重启么
快车0326 发表于 2025-3-17 22:06
我想不出这到底有什么长处,这些功能不自带吗都是! 为什么要多此一举呢
西门官人 发表于 2025-3-18 00:35
本帖最后由 西门官人 于 2025-3-17 22:37 编辑


这个软件挺奇怪的,不知道是杀了啥病毒,报毒之后,又可以正常打开了






li683305 发表于 2025-3-18 07:39
再添加一个定时关机就好了
cycloneblack 发表于 2025-3-18 09:08
yueyegufeng 发表于 2025-3-17 19:36
我还以为是可以设定时间自动关机重启呢,如果跟手机一样就好了

定时关机重启可以看一下这个软件:Wise Auto Shutdown,这个比较好用。
idnbil 发表于 2025-3-18 10:28
做的还可以,谢谢分享。
liangshushu 发表于 2025-3-18 12:02
谢谢分享
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2025-4-10 17:04

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表