打开图片查看器。
我想看图。
看个图片。
我想看张照片。
我想看美女。

result = ""

import os
import subprocess

def try_popen(args):
    try:
        subprocess.Popen(args, shell=False)
        return True
    except:
        return False

def try_start_uri(uri):
    # Windows 下启动 UWP/协议最稳的几种方式，按顺序尝试
    try:
        os.startfile(uri)
        return True
    except:
        pass

    try:
        subprocess.Popen(["cmd", "/c", "start", "", uri], shell=False)
        return True
    except:
        pass

    try:
        subprocess.Popen([
            "powershell",
            "-NoProfile",
            "-Command",
            "Start-Process '%s'" % uri
        ], shell=False)
        return True
    except:
        pass

    return False

# 1. 优先启动 Windows 照片
if try_start_uri("ms-photos:"):
    result = "已尝试启动图片查看器：Windows 照片"
else:
    # 2. 再尝试旧版 Windows 图片查看器
    photo_viewer_dll = r"C:\Program Files\Windows Photo Viewer\PhotoViewer.dll"
    rundll32 = r"C:\Windows\System32\rundll32.exe"

    if os.path.exists(rundll32) and os.path.exists(photo_viewer_dll):
        if try_popen([
            rundll32,
            photo_viewer_dll + ", ImageView_Fullscreen"
        ]):
            result = "已尝试启动图片查看器：Windows 图片查看器"
        else:
            result = "未能启动 Windows 自带图片查看器。"
    else:
        result = "未能启动 Windows 自带图片查看器。"
