本文目录导读:

Python脚本方式(推荐)
基础版 - 使用schedule库
import schedule
import time
from datetime import datetime
import winsound # Windows系统
# import os # macOS: os.system('say "提醒"')
def reminder(message):
print(f"[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] 提醒: {message}")
# Windows声音提醒
winsound.Beep(1000, 500) # 频率1000Hz,持续500ms
# macOS: os.system(f'say "{message}"')
# 设置定时任务
schedule.every().day.at("09:00").do(reminder, "早会时间到!")
schedule.every().day.at("12:00").do(reminder, "午餐时间")
schedule.every().day.at("18:00").do(reminder, "下班啦!")
# 也可以设置特定日期
schedule.every().monday.at("10:00").do(reminder, "周例会")
schedule.every().friday.at("16:00").do(reminder, "周报提交提醒")
print("行程提醒已启动...")
while True:
schedule.run_pending()
time.sleep(1)
进阶版 - 从文件读取行程
import schedule
import time
import json
from datetime import datetime, timedelta
import tkinter as tk
from tkinter import messagebox
class ItineraryReminder:
def __init__(self, config_file='itinerary.json'):
self.config_file = config_file
self.load_itineraries()
def load_itineraries(self):
"""从JSON文件加载行程"""
try:
with open(self.config_file, 'r', encoding='utf-8') as f:
self.itineraries = json.load(f)
except FileNotFoundError:
self.itineraries = []
self.save_itineraries()
def save_itineraries(self):
"""保存行程到JSON文件"""
with open(self.config_file, 'w', encoding='utf-8') as f:
json.dump(self.itineraries, f, ensure_ascii=False, indent=2)
def add_itinerary(self, time_str, message, days=None):
"""添加行程
time_str: "HH:MM" 格式
message: 提醒内容
days: 可选,指定星期几 ['mon','tue','wed','thu','fri','sat','sun']
"""
itinerary = {
'time': time_str,
'message': message,
'days': days,
'enabled': True
}
self.itineraries.append(itinerary)
self.save_itineraries()
def set_reminders(self):
"""设置所有行程提醒"""
for itinerary in self.itineraries:
if not itinerary.get('enabled', True):
continue
time_str = itinerary['time']
message = itinerary['message']
days = itinerary.get('days')
# 按天设置
if days:
for day in days:
getattr(schedule.every(), day).at(time_str).do(
self.show_reminder, message
)
else:
schedule.every().day.at(time_str).do(
self.show_reminder, message
)
def show_reminder(self, message):
"""显示提醒"""
print(f"\n[{datetime.now().strftime('%H:%M:%S')}] 📢 {message}")
# GUI弹出提醒(仅Windows)
try:
root = tk.Tk()
root.withdraw()
messagebox.showinfo("行程提醒", message)
root.destroy()
except:
pass
# 使用示例
reminder = ItineraryReminder()
# 添加行程
reminder.add_itinerary("09:00", "上班打卡")
reminder.add_itinerary("12:00", "午餐时间", days=['mon','tue','wed','thu','fri'])
reminder.add_itinerary("18:00", "准备下班")
# 设置提醒
reminder.set_reminders()
print("行程提醒系统已启动...")
while True:
schedule.run_pending()
time.sleep(1)
网页版(适合临时提醒)
HTML + JavaScript方案
<!DOCTYPE html>
<html>
<head>行程定时提醒</title>
<style>
body { font-family: Arial, sans-serif; padding: 20px; }
.container { max-width: 400px; margin: 0 auto; }
input, button { padding: 10px; margin: 5px; width: 100%; }
.reminder-item { border: 1px solid #ddd; padding: 10px; margin: 5px 0; }
.active { background: #f0f0f0; }
</style>
</head>
<body>
<div class="container">
<h2>行程定时提醒</h2>
<div>
<input type="text" id="message" placeholder="提醒内容">
<input type="time" id="time">
<button onclick="addReminder()">添加提醒</button>
</div>
<div id="reminders"></div>
</div>
<script>
let reminders = [];
function addReminder() {
const message = document.getElementById('message').value;
const time = document.getElementById('time').value;
if (!message || !time) {
alert('请填写完整信息');
return;
}
const reminder = {
id: Date.now(),
message: message,
time: time,
active: true
};
reminders.push(reminder);
displayReminders();
scheduleReminder(reminder);
}
function scheduleReminder(reminder) {
const [hours, minutes] = reminder.time.split(':');
const now = new Date();
const target = new Date();
target.setHours(parseInt(hours), parseInt(minutes), 0);
if (target <= now) {
target.setDate(target.getDate() + 1); // 如果时间已过,设置为明天
}
const delay = target - now;
setTimeout(() => {
if (reminder.active) {
showNotification(reminder.message);
// 可选:循环提醒
scheduleReminder(reminder);
}
}, delay);
}
function showNotification(message) {
// 浏览器通知
if (Notification.permission === 'granted') {
new Notification('行程提醒', {
body: message,
icon: 'https://via.placeholder.com/48'
});
} else if (Notification.permission !== 'denied') {
Notification.requestPermission().then(permission => {
if (permission === 'granted') {
new Notification('行程提醒', { body: message });
}
});
}
// 音频提醒
const audio = new Audio('https://www.soundjay.com/button/sounds/button-09.mp3');
audio.play();
}
function displayReminders() {
const container = document.getElementById('reminders');
container.innerHTML = reminders.map(r => `
<div class="reminder-item ${r.active ? 'active' : ''}">
<strong>${r.time}</strong> - ${r.message}
<button onclick="toggleReminder(${r.id})">
${r.active ? '暂停' : '恢复'}
</button>
<button onclick="deleteReminder(${r.id})">删除</button>
</div>
`).join('');
}
function toggleReminder(id) {
const reminder = reminders.find(r => r.id === id);
if (reminder) {
reminder.active = !reminder.active;
displayReminders();
}
}
function deleteReminder(id) {
reminders = reminders.filter(r => r.id !== id);
displayReminders();
}
// 请求通知权限
if (Notification.permission === 'default') {
Notification.requestPermission();
}
</script>
</body>
</html>
Windows任务计划程序(无代码方案)
创建PowerShell脚本(reminder.ps1)
# 定义提醒函数
function Show-Reminder {
param([string]$message)
# 弹出消息框
Add-Type -AssemblyName System.Windows.Forms
$popup = New-Object System.Windows.Forms.NotifyIcon
$popup.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon("powershell.exe")
$popup.BalloonTipIcon = "Info"
$popup.BalloonTipTitle = "行程提醒"
$popup.BalloonTipText = $message
$popup.Visible = $true
$popup.ShowBalloonTip(5000)
# 语音提醒
Add-Type -AssemblyName System.Speech
$synth = New-Object System.Speech.Synthesis.SpeechSynthesizer
$synth.Speak($message)
}
# 根据时间显示不同消息
$currentHour = (Get-Date).Hour
$currentMinute = (Get-Date).Minute
switch ($currentHour) {
9 { Show-Reminder "早上好,开始工作!" }
12 { Show-Reminder "午餐时间到!" }
13 { Show-Reminder "下午工作开始" }
17 { Show-Reminder "快要下班啦!" }
18 { Show-Reminder "下班时间到!" }
}
设置任务计划程序
- 打开"任务计划程序"
- 创建基本任务
- 设置触发器(每天,特定时间)
- 操作:启动程序 -> powershell.exe
- 参数:-File "C:\path\to\reminder.ps1"
移动端方案
Android (Tasker + AutoNotification)
- 安装Tasker
- 创建"时间"触发器
- 设置提醒时间和重复周期
- 添加"通知"动作
iOS (快捷指令)
- 创建自动化
- 选择"特定时间"
- 添加"显示提醒"操作
- 设置重复频率
建议
- 开发环境:推荐使用Python方式,简单易用
- 临时提醒:使用网页版本,无需安装
- 企业级:Windows任务计划程序方案
- 移动办公:使用手机自带或第三方应用
选择最适合您使用场景的方案即可!
版权声明:NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
足球直播
足球直播
足球直播
篮球直播
篮球直播
篮球直播
NBA直播
NBA直播
NBA直播
CBA直播
CBA直播
CBA直播
亚冠直播
亚冠直播
亚冠直播
欧冠直播
欧冠直播
欧冠直播
英超直播
英超直播
英超直播
西甲直播
西甲直播
西甲直播
中超直播
中超直播
中超直播
足球直播
足球直播
足球直播
篮球直播
篮球直播
篮球直播
NBA直播
NBA直播
NBA直播
CBA直播
CBA直播
CBA直播
亚冠直播
亚冠直播
亚冠直播
欧冠直播
欧冠直播
欧冠直播
英超直播
英超直播
英超直播
西甲直播
西甲直播
西甲直播
中超直播
中超直播
中超直播
足球直播
足球直播
足球直播
篮球直播
篮球直播
篮球直播
NBA直播
NBA直播
NBA直播
CBA直播
CBA直播
CBA直播
亚冠直播
亚冠直播
亚冠直播
欧冠直播
欧冠直播
欧冠直播
英超直播
英超直播
英超直播
西甲直播
西甲直播
西甲直播
中超直播
中超直播
中超直播
足球直播
足球直播
足球直播
篮球直播
篮球直播
篮球直播
NBA直播
NBA直播
NBA直播
CBA直播
CBA直播
CBA直播
亚冠直播
亚冠直播
亚冠直播
欧冠直播
欧冠直播
欧冠直播
英超直播
英超直播
英超直播
西甲直播
西甲直播
西甲直播
中超直播
中超直播
中超直播
曼联直播
曼联直播
曼联直播
日职联直播
日职联直播
日职联直播
澳超直播
澳超直播
澳超直播
阿森纳直播
阿森纳直播
阿森纳直播
足球直播
足球直播
足球直播
NBA直播
NBA直播
NBA直播
曼联直播
曼联直播
曼联直播
日职联直播
日职联直播
日职联直播
澳超直播
澳超直播
澳超直播
阿森纳直播
阿森纳直播
阿森纳直播
足球直播
足球直播
足球直播
NBA直播
NBA直播
NBA直播
曼联直播
曼联直播
曼联直播
日职联直播
日职联直播
日职联直播
澳超直播
澳超直播
澳超直播
阿森纳直播
阿森纳直播
阿森纳直播
足球直播
足球直播
足球直播
NBA直播
NBA直播
NBA直播
曼联直播
曼联直播
曼联直播
日职联直播
日职联直播
日职联直播
澳超直播
澳超直播
澳超直播
阿森纳直播
阿森纳直播
阿森纳直播
足球直播
足球直播
足球直播
NBA直播
NBA直播
NBA直播
欧冠直播
欧冠直播
欧冠直播
欧冠直播
欧冠直播
欧冠直播
欧冠直播
欧冠直播
欧冠直播
欧冠直播
欧冠直播
欧冠直播
欧冠直播
欧冠直播
欧冠直播
欧冠直播
欧冠直播
欧冠直播
欧冠直播
欧冠直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
足球直播
足球直播
足球直播
足球直播
足球直播
英超直播
英超直播
英超直播
英超直播
英超直播
篮球直播
篮球直播
篮球直播
篮球直播
篮球直播
CBA直播
CBA直播
CBA直播
CBA直播
CBA直播
中超直播
中超直播
中超直播
中超直播
中超直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
足球直播
足球直播
足球直播
足球直播
足球直播
英超直播
英超直播
英超直播
英超直播
英超直播
篮球直播
篮球直播
篮球直播
篮球直播
篮球直播
CBA直播
CBA直播
CBA直播
CBA直播
CBA直播
中超直播
中超直播
中超直播
中超直播
中超直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
NBA直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播
中超直播