好的,这是一个使用 Python 写的图像查看器的示例代码:
import os
from tkinter import Tk, Label, Button
from PIL import Image, ImageTk
class ImageViewer:
def __init__(self, root, file_path):
self.root = root
self.file_path = file_path
# 初始化窗口
self.root.title("图像查看器")
self.root.geometry("600x400")
self.root.resizable(Fa