当前位置:首页>python>Python:你好,世界

Python:你好,世界

  • 2026-01-11 13:54:27
Python:你好,世界
print("Hello, World!")
    新手快乐代码!!!
    # -*- coding: utf-8 -*-""""""import pygameimport randomimport mathimport colorsysfrom dataclasses import dataclassfrom typing import ListTupleOptionalfrom enum import Enum# 常量定义SCREEN_WIDTH = 800SCREEN_HEIGHT = 600FPS = 60# 颜色常量BACKGROUND_COLOR = (5515)TEXT_COLOR = (255255255)DEFAULT_HUE_RANGE = (0.120.14)  # 橙色到金色# 粒子参数TEXT_PARTICLE_SIZE_RANGE = (1.52.5)SPARK_PARTICLE_LENGTH_RANGE = (1020)SPARK_PARTICLE_WIDTH_RANGE = (0.51.5)TRAIL_LENGTH = 6TEXT_SPARK_LENGTH = 8# 烟花参数MIN_PARTICLES = 2MAX_PARTICLES = 3FIREWORK_SIZE_RANGE = (0.62.4)PARTICLE_COUNT_SCALE = 300SPECIAL_FIREWORK_CHANCE = 0.1COLORFUL_CHANCE = 0.15# 生命周期TEXT_MOVE_LIFE = 280TEXT_FORM_LIFE = 180SPARK_LIFE = 220# 物理参数GRAVITY = 0.2AIR_RESISTANCE = 0.88TEXT_PARTICLE_SPEED_RANGE = (69)SPARK_PARTICLE_SPEED_RANGE = (820)# 文本设置FONT_NAME = 'simhei'FONT_SIZE = 160TEXT = '新年快乐'TEXT_POINT_DENSITY = 3class ParticleState(Enum):    """粒子状态枚举"""    MOVING = "moving"    FORMING = "forming"@dataclassclass ParticleTrail:    """粒子轨迹数据类"""    positions: List[Tuple[floatfloat]]    max_length: intclass ParticleBase:    """粒子基类"""    def __init__(self, x: float, y: float, hue: float):        self.x = x        self.y = y        self.hue = hue        self.life = 0        self.trail = ParticleTrail([], 0)    def update(self) -> bool:        """更新粒子状态,返回是否存活"""        raise NotImplementedError    def draw(self, screen: pygame.Surface) -> None:        """绘制粒子"""        raise NotImplementedErrorclass TextParticle(ParticleBase):    """文字粒子类"""    def __init__(self, start_pos: Tuple[floatfloat], target_pos: Tuple[floatfloat]):        super().__init__(start_pos[0], start_pos[1], random.uniform(*DEFAULT_HUE_RANGE))        self.start_x, self.start_y = start_pos        self.target_x, self.target_y = target_pos        self.radius = random.uniform(*TEXT_PARTICLE_SIZE_RANGE)        # 计算初始速度        dx = self.target_x - self.start_x        dy = self.target_y - self.start_y        distance = math.hypot(dx, dy)        speed = random.uniform(*TEXT_PARTICLE_SPEED_RANGE) + distance / 60        self.vx = dx / distance * speed if distance > 0 else 0        self.vy = dy / distance * speed if distance > 0 else 0        # 初始化状态        self.state = ParticleState.MOVING        self.life = TEXT_MOVE_LIFE        self.trail = ParticleTrail([], TRAIL_LENGTH)    def _move_to_target(self) -> None:        """向目标位置移动"""        self.x += self.vx        self.y += self.vy        # 检查是否到达目标        distance_to_target = math.hypot(self.target_x - self.x, self.target_y - self.y)        if distance_to_target < 2 and self.state == ParticleState.MOVING:            self.state = ParticleState.FORMING            self.life = TEXT_FORM_LIFE    def update(self) -> bool:        """更新文字粒子状态"""        if self.state == ParticleState.MOVING:            self._move_to_target()        # 更新轨迹        self.trail.positions.append((self.x, self.y))        if len(self.trail.positions) > self.trail.max_length:            self.trail.positions.pop(0)        # 减少生命周期        self.life -= 2        return self.life > 0    def draw(self, screen: pygame.Surface) -> None:        """绘制文字粒子及其轨迹"""        trail_length = len(self.trail.positions)        for i, (x, y) in enumerate(self.trail.positions):            alpha = int(255 * (i + 1) / trail_length)            size = max(1self.radius * (trail_length - i) / trail_length)            color = hsv_to_rgb(self.hue, 0.150.95)            # 绘制轨迹点            pygame.draw.circle(screen, (*color, alpha), (int(x), int(y)), int(size))class SparkParticle(ParticleBase):    """火花粒子类"""    def __init__(self, x: float, y: float, angle: float, speed: float, hue: float):        super().__init__(x, y, hue)        self.length = random.uniform(*SPARK_PARTICLE_LENGTH_RANGE)        self.width = random.uniform(*SPARK_PARTICLE_WIDTH_RANGE)        self.angle = angle        # 初始速度        self.vx = math.cos(angle) * speed        self.vy = math.sin(angle) * speed        # 物理参数        self.gravity = GRAVITY        self.air_resist = AIR_RESISTANCE        # 生命周期和轨迹        self.life = SPARK_LIFE        self.trail = ParticleTrail([], TEXT_SPARK_LENGTH)    def update(self) -> bool:        """更新火花粒子状态"""        # 应用物理效果        self.vx *= self.air_resist        self.vy = self.vy * self.air_resist + self.gravity        self.x += self.vx        self.y += self.vy        # 更新轨迹        self.trail.positions.append((self.x, self.y))        if len(self.trail.positions) > self.trail.max_length:            self.trail.positions.pop(0)        # 减少生命周期        self.life -= 4        # 检查是否超出屏幕        is_alive = self.life > 0 and self.y < SCREEN_HEIGHT + 50        return is_alive    def draw(self, screen: pygame.Surface) -> None:        """绘制火花粒子及其轨迹"""        # 绘制轨迹线        for i in range(len(self.trail.positions) - 1):            x1, y1 = self.trail.positions[i]            x2, y2 = self.trail.positions[i + 1]            progress = i / (len(self.trail.positions) - 1)            alpha = int(255 * (1 - progress))            line_width = int(self.width * (1 - progress))            color = hsv_to_rgb(self.hue, 0.15 + progress * 0.10.9 - progress * 0.2)            pygame.draw.line(screen, (*color, alpha),                           (int(x1), int(y1)), (int(x2), int(y2)),                           line_width + 1)        # 绘制粒子头部        pygame.draw.circle(screen, hsv_to_rgb(self.hue, 0.10.98),                         (int(self.x), int(self.y)), int(self.width * 1.2))class Firework:    """烟花类,包含多个粒子"""    def __init__(self, x: float, y: float, size_scale: float = 1.0                 text_points: Optional[List[Tuple[floatfloat]]] = None):        self.particles: List[ParticleBase] = []        self.size_scale = size_scale        self.is_colorful = random.random() < COLORFUL_CHANCE        if text_points:            self._create_text_particles(x, y, text_points)        else:            self._create_spark_particles(x, y)    def _create_text_particles(self, x: float, y: float                              text_points: List[Tuple[floatfloat]]) -> None:        """创建文字粒子"""        for point in text_points:            self.particles.append(TextParticle((x, y), point))    def _create_spark_particles(self, x: float, y: float) -> None:        """创建火花粒子"""        particle_count = int(PARTICLE_COUNT_SCALE * self.size_scale)        for _ in range(particle_count):            angle = random.uniform(02 * math.pi)            speed = random.uniform(*SPARK_PARTICLE_SPEED_RANGE) * self.size_scale            # 随机决定颜色            if self.is_colorful:                hue = random.random()            else:                hue = (random.uniform(*DEFAULT_HUE_RANGE)                        if random.random() < SPECIAL_FIREWORK_CHANCE                        else random.random())            self.particles.append(SparkParticle(x, y, angle, speed, hue))    def update(self) -> bool:        """更新所有粒子,返回烟花是否还有存活粒子"""        self.particles = [p for p in self.particles if p.update()]        return len(self.particles) > 0    def draw(self, screen: pygame.Surface) -> None:        """绘制所有粒子"""        for particle in self.particles:            particle.draw(screen)class TextRenderer:    """文字渲染器"""    def __init__(self):        self.font = pygame.font.SysFont(FONT_NAME, FONT_SIZE)    def generate_text_points(self, density: int = TEXT_POINT_DENSITY) -> List[Tuple[floatfloat]]:        """生成文字轮廓点集"""        text_surface = self.font.render(TEXT, True, TEXT_COLOR)        mask = pygame.mask.from_surface(text_surface)        rect = text_surface.get_rect(center=(SCREEN_WIDTH // 2, SCREEN_HEIGHT // 2))        points = []        for x in range(0, text_surface.get_width(), density):            for y in range(0, text_surface.get_height(), density):                if mask.get_at((x, y)):                    # 添加随机偏移,使文字效果更自然                    points.append((                        rect.x + x + random.uniform(-11),                        rect.y + y + random.uniform(-11)                    ))        return pointsclass GameState(Enum):    """游戏状态枚举"""    TEXT_GENERATION = "text_generation"    TEXT_DISPLAY = "text_display"    NORMAL_FIREWORKS = "normal_fireworks"class FireworkDisplay:    """烟花表演主控制器"""    def __init__(self):        pygame.init()        self.screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))        pygame.display.set_caption("烟花秀")        self.clock = pygame.time.Clock()        self.fireworks: List[Firework] = []        self.state = GameState.TEXT_GENERATION        self.text_display_start = 0        self.background = self._create_background()        self.text_renderer = TextRenderer()    def _create_background(self) -> pygame.Surface:        """创建背景表面"""        background = pygame.Surface((SCREEN_WIDTH, SCREEN_HEIGHT))        background.fill(BACKGROUND_COLOR)        return background    def _handle_events(self) -> bool:        """处理事件,返回是否继续运行"""        for event in pygame.event.get():            if event.type == pygame.QUIT:                return False        return True    def _update_text_state(self, current_time: int) -> None:        """更新文字烟花状态"""        if self.state == GameState.TEXT_GENERATION:            # 生成文字烟花            text_points = self.text_renderer.generate_text_points()            self.fireworks.append(Firework(                SCREEN_WIDTH // 2, SCREEN_HEIGHT // 21.4, text_points            ))            self.text_display_start = current_time            self.state = GameState.TEXT_DISPLAY        elif self.state == GameState.TEXT_DISPLAY:            # 显示文字一段时间后切换到普通烟花            if current_time - self.text_display_start > 1000:                self.state = GameState.NORMAL_FIREWORKS    def _update_normal_state(self) -> None:        """更新普通烟花状态"""        if not self.fireworks:            # 生成新的烟花            for _ in range(random.randint(MIN_PARTICLES, MAX_PARTICLES)):                x = random.randint(100, SCREEN_WIDTH - 100)                y = random.randint(100, SCREEN_HEIGHT // 2)                size = random.uniform(*FIREWORK_SIZE_RANGE)                self.fireworks.append(Firework(x, y, size))    def _update_fireworks(self) -> None:        """更新所有烟花"""        for fw in self.fireworks[:]:            if not fw.update():                self.fireworks.remove(fw)    def _draw_fireworks(self) -> None:        """绘制所有烟花"""        for fw in self.fireworks:            fw.draw(self.screen)    def run(self) -> None:        """运行主循环"""        running = True        while running:            # 处理事件            running = self._handle_events()            # 清屏            self.screen.blit(self.background, (00))            # 获取当前时间            current_time = pygame.time.get_ticks()            # 状态管理            if self.state in [GameState.TEXT_GENERATION, GameState.TEXT_DISPLAY]:                self._update_text_state(current_time)            elif self.state == GameState.NORMAL_FIREWORKS:                self._update_normal_state()            # 更新和绘制烟花            self._update_fireworks()            self._draw_fireworks()            # 更新屏幕            pygame.display.flip()            self.clock.tick(FPS)        # 退出游戏        pygame.quit()def hsv_to_rgb(h: float, s: float, v: float) -> Tuple[intintint]:    """HSV颜色空间转RGB颜色空间"""    rgb = colorsys.hsv_to_rgb(h, s, v)    return tuple(round(i * 255for i in rgb)def main():    """主函数"""    display = FireworkDisplay()    display.run()if __name__ == "__main__":    main()
    """圣诞树动画 - 修复star_pulse属性错误"""import turtleimport randomimport mathfrom typing import ListTupleDictAnyclass EnhancedChristmasTree:    def __init__(self):        # 初始化屏幕        self.screen = turtle.Screen()        self.setup_screen()        # 初始化画笔        self.pen = turtle.Turtle()        self.setup_pen()        # 颜色定义        self.setup_colors()        # 存储动画元素        self.lights: List[Dict] = []        self.snowflakes: List[Dict] = []        self.ornaments: List[Dict] = []        # 动画控制        self.animation_speed = 0.05        self.time_counter = 0        self.star_pulse = 0  # 添加star_pulse属性初始化    def setup_screen(self):        """设置屏幕参数"""        self.screen.setup(width=800, height=700)        self.screen.bgcolor("#0a0f1f")        self.screen.title("🎄 动态圣诞树 🎄")        self.screen.tracer(0)        self.screen.colormode(255)    def setup_pen(self):        """设置画笔参数"""        self.pen.speed(0)        self.pen.hideturtle()        self.pen.pensize(2)    def setup_colors(self):        """设置颜色方案"""        self.colors = {            "bg""#0a0f1f",            "trunk""#5d4037",            "star""#ffeb3b",            "snow""#ffffff",        }        self.tree_gradient = [            "#0a5c36""#1b7a4b""#2e8b57""#4caf50""#81c784"        ]        self.ornament_colors = [            (2005050), (2001000), (20018050),            (7617580), (33150200), (15039176), (20064129)        ]        self.light_colors = [            (20018050), (2001507), (20010034),            (0150180), (2003099)        ]    def hex_to_rgb(self, hex_color: str) -> Tuple:        """十六进制颜色转RGB"""        hex_color = hex_color.lstrip('#')        return tuple(int(hex_color[i:i+2], 16for i in (024))    def draw_ground(self):        """绘制渐变地面"""        self.pen.penup()        self.pen.goto(-400, -250)        for i in range(50):            y = -250 - i            color_factor = i / 50            r = int(26 + (60 * color_factor))            g = int(35 + (30 * color_factor))            b = int(33 + (20 * color_factor))            self.pen.pendown()            self.pen.color(r, g, b)            self.pen.pensize(2)            self.pen.goto(400, y)            self.pen.penup()            self.pen.goto(-400, y)        for _ in range(20):            x = random.randint(-380380)            y = random.randint(-280, -250)            self.pen.goto(x, y)            self.pen.dot(2, (1008060))    def draw_trunk(self):        """绘制有纹理的树干"""        self.pen.penup()        self.pen.goto(-20, -250)        self.pen.pendown()        self.pen.color(self.colors["trunk"])        self.pen.begin_fill()        for _ in range(2):            self.pen.forward(40)            self.pen.left(90)            self.pen.forward(80)            self.pen.left(90)        self.pen.end_fill()        trunk_colors = [(936455), (1218572), (785246)]        for i in range(3):            x_offset = -15 + i * 15            self.pen.penup()            self.pen.goto(x_offset, -250)            self.pen.pendown()            self.pen.color(trunk_colors[i])            self.pen.pensize(3)            self.pen.setheading(90)            self.pen.forward(80)    def draw_tree_layer_gradient(self, x: float, y: float, width: float                                height: float, color_index: int):        """绘制渐变树冠层"""        self.pen.penup()        self.pen.goto(x, y)        for i in range(int(height)):            current_y = y + i            current_width = width * (1 - i/height)            current_x = x + (width - current_width) / 2            color_factor = i / height            if color_index < len(self.tree_gradient) - 1:                r1, g1, b1 = self.hex_to_rgb(self.tree_gradient[color_index])                r2, g2, b2 = self.hex_to_rgb(self.tree_gradient[color_index + 1])                r = int(r1 + (r2 - r1) * color_factor)                g = int(g1 + (g2 - g1) * color_factor)                b = int(b1 + (b2 - b1) * color_factor)            else:                r, g, b = self.hex_to_rgb(self.tree_gradient[color_index])            self.pen.penup()            self.pen.goto(current_x, current_y)            self.pen.pendown()            self.pen.color(r, g, b)            self.pen.pensize(2)            self.pen.goto(current_x + current_width, current_y)    def draw_tree(self):        """绘制整棵圣诞树"""        layers = [            (-120, -190240900),            (-100, -130200801),            (-80, -70160702),            (-60, -10120603),            (-405080504)        ]        for x, y, width, height, color_idx in layers:            self.draw_tree_layer_gradient(x, y, width, height, color_idx)    def draw_ornament(self, x: float, y: float, size: float = 8) -> turtle.Turtle:        """绘制单个装饰球"""        ornament = turtle.Turtle()        ornament.speed(0)        ornament.hideturtle()        ornament.penup()        base_color = random.choice(self.ornament_colors)        ornament.goto(x, y - size)        ornament.color(base_color)        ornament.begin_fill()        ornament.circle(size)        ornament.end_fill()        highlight_size = size * 0.4        highlight_x = x - size * 0.3        highlight_y = y - size + highlight_size * 0.5        ornament.penup()        ornament.goto(highlight_x, highlight_y)        ornament.color(240240240)        ornament.begin_fill()        ornament.circle(highlight_size)        ornament.end_fill()        self.ornaments.append({            "turtle": ornament,            "x": x,            "y": y,            "size": size,            "base_color": base_color,            "pulse_phase": random.uniform(0, math.pi * 2),            "pulse_speed": random.uniform(0.020.05),            "rotation"0,            "rotation_speed": random.uniform(-0.50.5)        })        return ornament    def draw_ornaments(self, count: int = 20):        """绘制多个装饰球"""        positions = [            {"x_range": (-110, -60), "y_range": (-180, -120)},            {"x_range": (-60, -20), "y_range": (-120, -60)},            {"x_range": (-2020), "y_range": (-600)},            {"x_range": (2060), "y_range": (060)},            {"x_range": (60110), "y_range": (60100)}        ]        for _ in range(count):            area = random.choice(positions)            x = random.uniform(area["x_range"][0], area["x_range"][1])            y = random.uniform(area["y_range"][0], area["y_range"][1])            size = random.uniform(610)            self.draw_ornament(x, y, size)    def draw_fairy_light(self, x: float, y: float, size: float = 4) -> turtle.Turtle:        """绘制单个彩灯"""        light = turtle.Turtle()        light.speed(0)        light.hideturtle()        light.penup()        base_color = random.choice(self.light_colors)        light.goto(x, y - size)        light.color(base_color)        light.begin_fill()        light.circle(size)        light.end_fill()        self.lights.append({            "turtle": light,            "x": x,            "y": y,            "size": size,            "base_color": base_color,            "current_color": base_color,            "target_color": random.choice(self.light_colors),            "color_progress"0,            "color_speed": random.uniform(0.010.03),            "pulse_phase": random.uniform(0, math.pi * 2),            "pulse_speed": random.uniform(0.030.07)        })        return light    def draw_fairy_lights(self, count: int = 30):        """绘制多个彩灯"""        positions = [            {"x_range": (-120, -80), "y_range": (-190, -150)},            {"x_range": (-80, -50), "y_range": (-150, -100)},            {"x_range": (-50, -20), "y_range": (-100, -40)},            {"x_range": (-2010), "y_range": (-4020)},            {"x_range": (1040), "y_range": (2070)},            {"x_range": (40120), "y_range": (70100)}        ]        for _ in range(count):            area = random.choice(positions)            x = random.uniform(area["x_range"][0], area["x_range"][1])            y = random.uniform(area["y_range"][0], area["y_range"][1])            size = random.uniform(35)            self.draw_fairy_light(x, y, size)    def draw_star(self, x: float = 0, y: float = 120, size: float = 25):        """绘制动态星星"""        self.star_turtle = turtle.Turtle()        self.star_turtle.speed(0)        self.star_turtle.hideturtle()        self.star_turtle.penup()        self.star_turtle.goto(x, y)        self.star_turtle.setheading(72)        self.star_turtle.pendown()        # 绘制初始星星        self.star_turtle.color(self.colors["star"])        self.star_turtle.begin_fill()        for _ in range(5):            self.star_turtle.forward(size)            self.star_turtle.right(144)            self.star_turtle.forward(size)            self.star_turtle.left(72)        self.star_turtle.end_fill()    def create_snowflake(self) -> Dict:        """创建单个雪花"""        flake = turtle.Turtle()        flake.speed(0)        flake.hideturtle()        flake.penup()        x = random.uniform(-380380)        y = random.uniform(320400)        flake.goto(x, y)        flake.color(self.colors["snow"])        flake.shape("circle")        flake.shapesize(random.uniform(0.10.3))        return {            "turtle": flake,            "x": x,            "y": y,            "size": random.uniform(38),            "fall_speed": random.uniform(0.52.0),            "drift_speed": random.uniform(-0.50.5),            "drift_amplitude": random.uniform(0.52.0),            "rotation": random.uniform(0, math.pi * 2),            "rotation_speed": random.uniform(-0.050.05),            "pulse_phase": random.uniform(0, math.pi * 2),            "pulse_speed": random.uniform(0.020.05)        }    def draw_snow(self, count: int = 60):        """创建雪花"""        for _ in range(count):            snowflake = self.create_snowflake()            self.snowflakes.append(snowflake)    def draw_message(self):        """绘制祝福消息"""        message = turtle.Turtle()        message.speed(0)        message.hideturtle()        message.penup()        message.goto(0, -300)        message.color("#ffffff")        message.write("Merry Christmas!", align="center"                     font=("Arial"24"bold"))        message.penup()        message.goto(0, -330)        message.color("#ffd700")        message.write("愿您和您的家人圣诞快乐!", align="center"                     font=("Arial"16"italic"))    def update_lights(self):        """更新彩灯颜色和大小"""        for light in self.lights:            if light["color_progress"] >= 1:                light["color_progress"] = 0                light["current_color"] = light["target_color"]                light["target_color"] = random.choice(self.light_colors)            else:                light["color_progress"] += light["color_speed"]                r = int(light["current_color"][0] +                        (light["target_color"][0] - light["current_color"][0]) *                        light["color_progress"])                g = int(light["current_color"][1] +                        (light["target_color"][1] - light["current_color"][1]) *                        light["color_progress"])                b = int(light["current_color"][2] +                        (light["target_color"][2] - light["current_color"][2]) *                        light["color_progress"])                r = max(0min(255, r))                g = max(0min(255, g))                b = max(0min(255, b))                light["turtle"].clear()                light["turtle"].penup()                light["turtle"].goto(light["x"], light["y"] - light["size"])                light["turtle"].pendown()                light["turtle"].color(r, g, b)                light["turtle"].begin_fill()                light["turtle"].circle(light["size"])                light["turtle"].end_fill()            pulse = math.sin(light["pulse_phase"]) * 0.2 + 0.9            light["pulse_phase"] += light["pulse_speed"]            current_size = light["size"] * pulse            light["turtle"].shapesize(current_size/20, current_size/20)    def update_ornaments(self):        """更新装饰球"""        for ornament in self.ornaments:            pulse = math.sin(ornament["pulse_phase"]) * 0.1 + 0.95            ornament["pulse_phase"] += ornament["pulse_speed"]            ornament["rotation"] += ornament["rotation_speed"]            r, g, b = ornament["base_color"]            brightness = pulse * 0.1 + 0.9            r = int(r * brightness)            g = int(g * brightness)            b = int(b * brightness)            r = max(0min(255, r))            g = max(0min(255, g))            b = max(0min(255, b))            ornament["turtle"].clear()            ornament["turtle"].penup()            ornament["turtle"].goto(ornament["x"], ornament["y"] - ornament["size"])            ornament["turtle"].setheading(ornament["rotation"])            ornament["turtle"].color(r, g, b)            ornament["turtle"].begin_fill()            ornament["turtle"].circle(ornament["size"])            ornament["turtle"].end_fill()            highlight_size = ornament["size"] * 0.4            highlight_x = ornament["x"] - ornament["size"] * 0.3            highlight_y = ornament["y"] - ornament["size"] + highlight_size * 0.5            ornament["turtle"].penup()            ornament["turtle"].goto(highlight_x, highlight_y)            ornament["turtle"].color(240240240)            ornament["turtle"].begin_fill()            ornament["turtle"].circle(highlight_size)            ornament["turtle"].end_fill()    def update_snow(self):        """更新雪花位置"""        for snowflake in self.snowflakes:            snowflake["y"] -= snowflake["fall_speed"]            snowflake["x"] += math.sin(self.time_counter + snowflake["pulse_phase"]) * snowflake["drift_amplitude"]            snowflake["rotation"] += snowflake["rotation_speed"]            pulse = math.sin(self.time_counter + snowflake["pulse_phase"]) * 0.2 + 0.9            current_size = snowflake["size"] * pulse            snowflake["turtle"].goto(snowflake["x"], snowflake["y"])            snowflake["turtle"].setheading(snowflake["rotation"] * 180 / math.pi)            snowflake["turtle"].shapesize(current_size/20, current_size/20)            if snowflake["y"] < -320:                snowflake["y"] = random.uniform(320400)                snowflake["x"] = random.uniform(-380380)                snowflake["fall_speed"] = random.uniform(0.52.0)    def update_star(self):        """更新星星效果"""        # 更新脉动相位        self.star_pulse += 0.1        # 星星脉动效果        pulse_size = 25 + math.sin(self.star_pulse) * 3        # 脉动颜色        r = 255        g = 235 + int(math.sin(self.star_pulse) * 20)        b = 59        g = max(0min(255, g))        # 清除并重新绘制星星        self.star_turtle.clear()        self.star_turtle.penup()        self.star_turtle.goto(0120)        self.star_turtle.setheading(72)        self.star_turtle.pendown()        self.star_turtle.color(r, g, b)        self.star_turtle.begin_fill()        for _ in range(5):            self.star_turtle.forward(pulse_size)            self.star_turtle.right(144)            self.star_turtle.forward(pulse_size)            self.star_turtle.left(72)        self.star_turtle.end_fill()    def animate(self):        """主动画循环"""        self.time_counter += 0.05        self.update_lights()        self.update_ornaments()        self.update_snow()        self.update_star()        if random.random() < 0.1 and len(self.snowflakes) < 100:            self.snowflakes.append(self.create_snowflake())        self.snowflakes = [flake for flake in self.snowflakes if flake["y"] > -320]        self.screen.update()        self.screen.ontimer(self.animate, 20)    def draw(self):        """绘制所有元素"""        print("🎨 绘制圣诞树...")        self.draw_ground()        self.draw_trunk()        self.draw_tree()        self.draw_ornaments(20)        self.draw_fairy_lights(30)        self.draw_star()        self.draw_snow(60)        self.draw_message()        self.screen.update()        print("✨ 圣诞树绘制完成!")        self.animate()    def run(self):        """运行主程序"""        print("=" * 50)        print("🎄 动态圣诞树动画 🎄")        print("=" * 50)        print("正在初始化...")        self.draw()        self.screen.mainloop()def main():    """主函数"""    tree = EnhancedChristmasTree()    tree.run()if __name__ == "__main__":    main()

    最新文章

    随机文章

    基本 文件 流程 错误 SQL 调试
    1. 请求信息 : 2026-02-08 23:07:20 HTTP/2.0 GET : https://f.mffb.com.cn/a/461115.html
    2. 运行时间 : 0.367699s [ 吞吐率:2.72req/s ] 内存消耗:4,796.88kb 文件加载:140
    3. 缓存信息 : 0 reads,0 writes
    4. 会话信息 : SESSION_ID=35d93fb99e46506d74fd5a86dd46cdb5
    1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
    2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
    3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
    4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
    5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
    6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
    7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
    8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
    9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
    10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
    11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
    12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
    13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
    14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
    15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
    16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
    17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
    18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
    19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
    20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
    21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
    22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
    23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
    24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
    25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
    26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
    27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
    28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
    29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
    30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
    31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
    32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
    33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
    34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
    35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
    36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
    37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
    38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
    39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
    40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
    41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
    42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
    43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
    44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
    45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
    46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
    47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
    48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
    49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
    50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
    51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
    52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
    53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
    54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
    55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
    56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
    57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
    58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
    59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
    60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
    61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
    62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
    63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
    64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
    65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
    66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
    67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
    68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
    69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
    70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
    71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
    72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
    73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
    74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
    75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
    76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
    77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
    78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
    79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
    80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
    81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
    82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
    83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
    84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
    85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
    86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
    87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
    88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
    89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
    90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
    91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
    92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
    93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
    94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
    95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
    96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
    97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
    98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
    99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
    100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
    101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
    102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
    103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
    104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
    105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
    106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
    107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
    108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
    109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
    110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
    111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
    112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
    113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
    114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
    115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
    116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
    117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
    118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
    119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
    120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
    121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
    122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
    123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
    124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
    125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
    126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
    127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
    128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
    129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
    130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
    131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
    132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
    133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
    134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
    135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
    136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
    137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
    138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
    139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
    140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
    1. CONNECT:[ UseTime:0.000900s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
    2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001250s ]
    3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.001963s ]
    4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.014098s ]
    5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001529s ]
    6. SELECT * FROM `set` [ RunTime:0.002820s ]
    7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001301s ]
    8. SELECT * FROM `article` WHERE `id` = 461115 LIMIT 1 [ RunTime:0.016036s ]
    9. UPDATE `article` SET `lasttime` = 1770563241 WHERE `id` = 461115 [ RunTime:0.013977s ]
    10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.001199s ]
    11. SELECT * FROM `article` WHERE `id` < 461115 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.031278s ]
    12. SELECT * FROM `article` WHERE `id` > 461115 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.035915s ]
    13. SELECT * FROM `article` WHERE `id` < 461115 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.050428s ]
    14. SELECT * FROM `article` WHERE `id` < 461115 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.005103s ]
    15. SELECT * FROM `article` WHERE `id` < 461115 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.013194s ]
    0.369380s