关闭记事本

import subprocess

print("正在关闭记事本...")

# 记事本进程名
notepads = [
    "notepad.exe"
]

for app in notepads:
    subprocess.run(
        ["taskkill", "/f", "/im", app],
        stdout=subprocess.DEVNULL,
        stderr=subprocess.DEVNULL
    )

result = "记事本已关闭"

print(result)
