如何用python写一个小程序,如何用python制作小程序

python编程100个小程序,python简单的小程序 这篇文章主要介绍了python编程100个小程序,具有一定借鉴价值,需要的朋友可以参考下。希望大家阅读完这篇文章后大有收获,下面让小编带着大家一起了解一下。简单Python入门小程序。 阅读详情

大家好,给大家分享一下用python编写一个微信小程序,很多人还不知道这一点。下面详细解释一下。现在让我们来看看!

Source code download: 本文相关源码

大家好,小编来为大家解答以下问题,用python编写一个小程序,python入门小程序编写,今天让我们一起来看看吧!

一:樱花树

运行效果:
在这里插入图片描述

完整代码如下:

import turtle
import random
from turtle import *
from time import sleep

# 画樱花的躯干(60,t)
def tree(branchLen,t):
    sleep(0.0005)
    if branchLen >3:
        if 8<= branchLen <=12:
            if random.randint(0,2) == 0:
                t.color('snow') # 白
            else:
                t.color('lightcoral') # 淡珊瑚色
            t.pensize(branchLen / 3)
        elif branchLen <8:
            if random.randint(0,1) == 0:
                t.color('snow')
            else:
                t.color('lightcoral') # 淡珊瑚色
            t.pensize(branchLen / 2)
        else:
            t.color('sienna') # 赭(zhě)色
            t.pensize(branchLen / 10) # 6
        t.forward(branchLen)
        a = 1.5 * random.random()
        t.right(20*a)
        b = 1.5 * random.random()
        tree(branchLen-10*b, t)
        t.left(40*a)
        tree(branchLen-10*b, t)
        t.right(20*a)
        t.up()
        t.backward(branchLen)
        t.down()
 
# 掉落的花瓣
def petal(m, t):
    for i in range(m):
        a = 200 - 400 * random.random()
        b = 10 - 20 * random.random()
        t.up()
        t.forward(b)
        t.left(90)
        t.forward(a)
        t.down()
        t.color('lightcoral') # 淡珊瑚色
        t.circle(1)
        t.up()
        t.backward(a)
        t.right(90)
        t.backward(b)
 
def main():
    # 绘图区域
    t = turtle.Turtle()
    # 画布大小
    w = turtle.Screen()
    t.hideturtle() # 隐藏画笔
    getscreen().tracer(1,0)
    w.screensize(bg='wheat')
    t.left(90)
    t.up()
    t.backward(150)
    t.down()
    t.color('sienna')
 
    # 画樱花的躯干
    tree(60,t)
    
    # 掉落的花瓣
    petal(200, t)
    w.exitonclick()
 
main()

二:呆萌小鸭子

运行效果:
在这里插入图片描述

完整代码如下:

from turtle import *
 
#扁嘴
pensize(2)
 
pu()
goto(-100,100)#上嘴最高顶点
seth(-50)
pd()
color('#6C3100','#FADD77')
begin_fill()
fd(16)
vertex_right = pos()#嘴最右顶点
rt(50)
fd(12)
vertex_down = pos()#下嘴最低顶点
rt(80)
fd(30)
circle(-3,200)
vertex_left = pos()#嘴最左顶点
goto(-100,100)
end_fill()
goto(vertex_left)#回到最左顶点
circle(-3,-200)#扁嘴
goto(vertex_right)
    
#身体
#头颈背尾曲线
color('#B6A88E')
pu()
goto(-100,100)
pd()
 
seth(80)
circle(-36,160)
fd(25)
circle(115,20)
circle(60,55)
circle(-200,20)
circle(110,20)
color('#7D6A4C')
circle(40,40)
color('#B6A88E')
seth(-100)
circle(-180,30)
circle(-20,50)
 
#右鸭腿
circle(20,70)
color('#736856')
circle(-12,120)
leg_pos1 = pos()#定位左腿位置
fd(25)
 
#前胸肚曲线
pu()
goto(vertex_down)
pd()
seth(-10)
color('#B9AD9D')
circle(-40,50)
circle(-80,48)
color('#736856')
circle(250,5)
circle(50,75)
color('#B9AD9D')
circle(220,28)
 
#左鸭腿
pu()
seth(175)
fd(40)
pd()
seth(-120)
fd(8)
circle(-10,120)
leg_pos2 = pos()#定位右腿位置
fd(15)
 
#眼睛
color('black')
#左眼
pu()
goto(vertex_down - (1,-29))
pd()
dot(4,'black')
#右眼
pu()
goto(vertex_down + (23,20))
pd()
dot(4,'black')
 
#翅膀
color('#BCB2A6')
pu()
goto(vertex_down - (-75,130))
seth(130)
pd()
circle(-25,130)
circle(-100,30)
fd(85)
point = pos()
rt(137)
fd(52)
circle(-100,58)
 
pu()
goto(point)
lt(30)
pd()
fd(60)
 
pu()
goto(point)
pd()
lt(10)
fd(70)

#腿部
#左腿
def leg(pos0):#鸭腿绘制函数
    pensize(8)
    color('#ECC578')
    pu()
    goto(pos0)
    seth(0)
    fd(7)
    seth(-90)
    fd(8.5)
    pd()
    fd(20)#腿长
 
leg(leg_pos1)
leg(leg_pos2)
 
#小红靴——函数
def boot(pos0):
    pensize(2)
    color('#B4070B','#FBA06B')
    pu()
    goto(pos0)#靴子右上顶点
    pd()
    begin_fill()
    seth(140)
    circle(25,80)
    seth(-80)
    fd(35)
 
    circle(-2,60)#靴低
    fd(20)
    circle(4,180)    
    seth(5)
    fd(30)
    circle(2,60)
    
    goto(pos0)#右侧线条
    end_fill()
    
boot(leg_pos1-(-20,30))
boot(leg_pos2-(-20,30)) 
 
#小雨滴
color('#77DDFF','#D8E8E5')
fd_ls = [200,140,250,240,230,220,180,250]
lt_ls = [30,60,60,100,125,170,200,330]
for i in range(8):
    pu()
    home()    
    lt(lt_ls[i])
    fd(fd_ls[i])
 
    pd()
    seth(-78)
    fd(15)
    begin_fill()
    circle(-3,200)
    end_fill()
    fd(15)
 
#文字
pu()
goto(vertex_left)
seth(180)
fd(150)
seth(-90)
fd(300)
color('black')
write('呆萌小鸭子',font=("Arial",15,"normal"))
    
hideturtle()
done()

三:计算器

运行效果:
在这里插入图片描述

完整代码如下:

import tkinter as tk

class Calc(tk.Tk):
    """计算器窗体类"""
    def __init__(self):
        """初始化实例"""
        tk.Tk.__init__(self)
        self.title("计算器")
        self.memory = 0  # 暂存数值
        self.create()

    def create(self):
        """创建界面"""
        btn_list = ["C", "M->", "->M", "/",
                    "7", "8", "9", "*",
                    "4", "5", "6", "-",
                    "1", "2", "3", "+",
                    "+/-", "0", ".", "="]
        r = 1
        c = 0
        for b in btn_list:
            self.button = tk.Button(self, text=b, width=5,
                                    command=(lambda x=b: self.click(x)))
            self.button.grid(row=r, column=c, padx=3, pady=6)
            c += 1
            if c > 3:
                c = 0
                r += 1
        self.entry = tk.Entry(self, width=24, borderwidth=2,
                              bg="yellow", font=("Consolas", 12))
        self.entry.grid(row=0, column=0, columnspan=4, padx=8, pady=6)

    def click(self, key):
        """响应按钮"""
        if key == "=":  # 输出结果
            result = eval(self.entry.get())
            self.entry.insert(tk.END, " = " + str(result))
        elif key == "C":  # 清空输入框
            self.entry.delete(0, tk.END)
        elif key == "->M":  # 存入数值
            self.memory = self.entry.get()
            if "=" in self.memory:
                ix = self.memory.find("=")
                self.memory = self.memory[ix + 2:]
            self.title("M=" + self.memory)
        elif key == "M->":  # 取出数值
            if self.memory:
                self.entry.insert(tk.END, self.memory)
        elif key == "+/-":  # 正负翻转
            if "=" in self.entry.get():
                self.entry.delete(0, tk.END)
            elif self.entry.get()[0] == "-":
                self.entry.delete(0)
            else:
                self.entry.insert(0, "-")
        else:  # 其他键
            if "=" in self.entry.get():
                self.entry.delete(0, tk.END)
            self.entry.insert(tk.END, key)

if __name__ == "__main__":
    Calc().mainloop()

四:皮卡丘

运行效果:
在这里插入图片描述

完整代码如下:

from turtle import *
'''
绘制皮卡丘头部
'''
def face(x,y):
    """画脸"""
    begin_fill()
    penup()
    # 将海龟移动到指定的坐标
    goto(x, y)
    pendown()
    # 设置海龟的方向
    setheading(40)

    circle(-150, 69)
    fillcolor("#FBD624")
    # 将海龟移动到指定的坐标
    
    penup()
    goto(53.14, 113.29)
    pendown()
    setheading(300)
    circle(-150, 30)
    setheading(295)
    circle(-140, 20)
    print(position())
    forward(5)
    setheading(260)
    circle(-80, 70)
    print(position())
    penup()
    goto(-74.43,-79.09)
    pendown()
    penup()
    # 将海龟移动到指定的坐标
    goto(-144,103)
    pendown()
    setheading(242)
    circle(110, 35)
    right(10)
    forward(10)
    setheading(250)
    circle(80, 115)
    print(position())
    penup()
    goto(-74.43,-79.09)
    pendown()
    setheading(10)
    penup()
    goto(-144, 103)
    pendown()
    penup()
    goto(x, y)
    pendown()
    end_fill()

    # 下巴
    penup()
    goto(-50, -82.09)
    pendown()
    pencolor("#DDA120")
    fillcolor("#DDA120")
    begin_fill()
    setheading(-12)
    circle(120, 25)
    setheading(-145)
    forward(30)
    setheading(180)
    circle(-20, 20)
    setheading(143)
    forward(30)
    end_fill()

def eye():
    """画眼睛"""
    # 左眼
    color("black","black")
    penup()
    goto(-110, 27)
    pendown()
    begin_fill()
    setheading(0)
    circle(24)
    end_fill()
    # 左眼仁
    color("white", "white")
    penup()
    goto(-105, 51)
    pendown()
    begin_fill()
    setheading(0)
    circle(10)
    end_fill()
    # 右眼
    color("black", "black")
    penup()
    goto(25, 40)
    pendown()
    begin_fill()
    setheading(0)
    circle(24)
    end_fill()
    # 右眼仁
    color("white", "white")
    penup()
    goto(17, 62)
    pendown()
    begin_fill()
    setheading(0)
    circle(10)
    end_fill()
def cheek():
    """画脸颊"""
    # 右边
    color("#9E4406", "#FE2C21")
    penup()
    goto(-130, -50)
    pendown()
    begin_fill()
    setheading(0)
    circle(27)
    end_fill()

    # 左边
    color("#9E4406", "#FE2C21")
    penup()
    goto(53, -20)
    pendown()
    begin_fill()
    setheading(0)
    circle(27)
    end_fill()

def nose():
    """画鼻子"""
    color("black", "black")
    penup()
    goto(-40, 38)
    pendown()
    begin_fill()
    circle(7,steps = 3)
    end_fill()
def mouth():
    """画嘴"""
    color("black", "#F35590")
    # 嘴唇
    penup()
    goto(-10, 22)
    pendown()
    begin_fill()
    setheading(260)
    forward(60)
    circle(-11, 150)
    forward(55)
    print(position())
    penup()
    goto(-38.46, 21.97)
    pendown()
    end_fill()

    # 舌头
    color("#6A070D", "#6A070D")
    begin_fill()
    penup()
    goto(-10.00, 22.00)
    pendown()
    penup()
    goto(-14.29, -1.7)
    pendown()
    penup()
    goto(-52, -5)
    pendown()
    penup()
    goto(-60.40, 12.74)
    pendown()
    penup()
    goto(-38.46, 21.97)
    pendown()
    penup()
    goto(-10.00, 22.00)
    pendown()
    end_fill()
    color("black","#FFD624")
    penup()
    goto(-78, 15)
    pendown()
    begin_fill()
    setheading(-25)
    for i in range(2):
        setheading(-25)
        circle(35, 70)

    end_fill()
    color("#AB1945", "#AB1945")
    penup()
    goto(-52, -5)
    pendown()
    begin_fill()
    setheading(40)
    circle(-33, 70)
    goto(-16,-1.7)
    penup()
    goto(-18,-17)
    pendown()
    setheading(155)
    circle(25, 70)
    end_fill()

def ear():
    """画耳朵"""
    # 左耳
    color("black","#FFD624")
    penup()
    goto(-145, 93)
    pendown()
    begin_fill()
    setheading(165)
    circle(-248,50)
    right(120)
    circle(-248,50)
    end_fill()
    color("black", "black")
    penup()
    goto(-240, 143)
    pendown()
    begin_fill()
    setheading(107)
    circle(-170, 25)
    left(80)
    circle(229, 15)
    left(120)
    circle(300, 15)
    end_fill()

    # 右耳
    color("black", "#FFD624")
    penup()
    goto(30, 136)
    pendown()
    begin_fill()
    setheading(64)
    circle(-248, 50)

    right(120)
    circle(-248, 50)
    end_fill()
    color("black", "black")
    penup()
    goto(160, 200)
    pendown()
    begin_fill()
    setheading(52)
    circle(170, 25)
    left(116)
    circle(229, 15)
    left(71)
    circle(-300, 15)
    end_fill()
def setting():
    """设置参数"""
    pensize(2)
    # 隐藏海龟
    hideturtle()
    speed(10)
def main():
    """主函数"""
    setting()
    face(-132,115)
    eye()
    cheek()
    nose()
    mouth()
    ear()
    done()

if __name__ == '__main__':
    main()

五:表白专用

运行效果:
在这里插入图片描述
在这里插入图片描述

完整代码如下:

import turtle
import time

# 清屏函数
def clear_all():
    turtle.penup()
    turtle.goto(0, 0)
    turtle.color('white')
    turtle.pensize(800)
    turtle.pendown()
    turtle.setheading(0)
    turtle.fd(300)
    turtle.bk(600)
 
# 重定位海龟的位置
def go_to(x, y, state):
    turtle.pendown() if state else turtle.penup()
    turtle.goto(x, y)

# 画线
# state为真时海龟回到原点,为假时不回到原来的出发点
def draw_line(length, angle, state):
    turtle.pensize(1)
    turtle.pendown()
    turtle.setheading(angle)
    turtle.fd(length)
    turtle.bk(length) if state else turtle.penup()
    turtle.penup()

# 画箭羽
def draw_feather(size):
    angle = 30                          # 箭的倾角
    feather_num = size//6               # 羽毛的数量
    feather_length = size // 3          # 羽毛的长度
    feather_gap = size//10              # 羽毛的间隔
    for i in range(feather_num):
        draw_line(feather_gap, angle+180, False)            # 箭柄,不折返
        draw_line(feather_length, angle + 145, True)        # 羽翼,要折返
    draw_line(feather_length, angle + 145, False)
    draw_line(feather_num*feather_gap, angle, False)
    draw_line(feather_length, angle + 145 + 180, False)
    for i in range(feather_num):
        draw_line(feather_gap, angle+180, False)            # 箭柄,不折返
        draw_line(feather_length, angle - 145, True)        # 羽翼,要折返
    draw_line(feather_length, angle - 145, False)
    draw_line(feather_num*feather_gap, angle, False)
    draw_line(feather_length, angle - 145 + 180, False)
 
# 画爱心
def draw_heart(size):
    turtle.color('red', 'pink')
    turtle.pensize(2)
    turtle.pendown()
    turtle.setheading(150)
    turtle.begin_fill()
    turtle.fd(size)
    turtle.circle(size * -3.745, 45)
    turtle.circle(size * -1.431, 165)
    turtle.left(120)
    turtle.circle(size * -1.431, 165)
    turtle.circle(size * -3.745, 45)
    turtle.fd(size)
    turtle.end_fill()

# 画箭
def draw_arrow(size):
    angle = 30
    turtle.color('black')
    draw_feather(size)
    turtle.pensize(4)
    turtle.setheading(angle)
    turtle.pendown()
    turtle.fd(size*2)
 
# 一箭穿心
# 箭的头没有画出来,而是用海龟来代替
def arrow_heart(x, y, size):
    go_to(x, y, False)
    draw_heart(size*1.15)
    turtle.setheading(-150)
    turtle.penup()
    turtle.fd(size*2.2)
    draw_heart(size)
    turtle.penup()
    turtle.setheading(150)
    turtle.fd(size * 2.2)
    draw_arrow(size)

# 画出发射爱心的小人
def draw_people(x, y):
    turtle.penup()
    turtle.goto(x, y)
    turtle.pendown()
    turtle.pensize(2)
    turtle.color('black')
    turtle.setheading(0)
    turtle.circle(60, 360)
    turtle.penup()
    turtle.setheading(90)
    turtle.fd(75)
    turtle.setheading(180)
    turtle.fd(20)
    turtle.pensize(4)
    turtle.pendown()
    turtle.circle(2, 360)
    turtle.setheading(0)
    turtle.penup()
    turtle.fd(40)
    turtle.pensize(4)
    turtle.pendown()
    turtle.circle(-2, 360)
    turtle.penup()
    turtle.goto(x, y)
    turtle.setheading(-90)
    turtle.pendown()
    turtle.fd(20)
    turtle.setheading(0)
    turtle.fd(35)
    turtle.setheading(60)
    turtle.fd(10)
    turtle.penup()
    turtle.goto(x, y)
    turtle.setheading(-90)
    turtle.pendown()
    turtle.fd(40)
    turtle.setheading(0)
    turtle.fd(35)
    turtle.setheading(-60)
    turtle.fd(10)
    turtle.penup()
    turtle.goto(x, y)
    turtle.setheading(-90)
    turtle.pendown()
    turtle.fd(60)
    turtle.setheading(-135)
    turtle.fd(60)
    turtle.bk(60)
    turtle.setheading(-45)
    turtle.fd(30)
    turtle.setheading(-135)
    turtle.fd(35)
    turtle.penup()

# 第一个画面,显示文字
def page0():
    turtle.penup()
    turtle.goto(-350, 0)
    turtle.color('black')
    turtle.write('专属于我们的什么节', font=('宋体', 60, 'normal')) #这里的字大家自己替换
    time.sleep(3)
 
# 第二个画面,显示发射爱心的小人
def page1():
    turtle.speed(10)
    draw_people(-250, 20)
    turtle.penup()
    turtle.goto(-150, -30)
    draw_heart(14)
    turtle.penup()
    turtle.goto(-20, -60)
    draw_heart(25)
    turtle.penup()
    turtle.goto(250, -100)
    draw_heart(45)
    turtle.hideturtle()
    time.sleep(3)
 
# 最后一个画面,一箭穿心
def page2():
    turtle.speed(1)
    turtle.penup()
    turtle.goto(-200, -200)
    turtle.color('blue')
    turtle.pendown()
    turtle.write('温轻舟       温轻舟', font=('wisdom', 25, 'normal')) #这里的字大家自己替换
    turtle.penup()
    turtle.goto(0, -180)
    draw_heart(10)
    arrow_heart(20, -60, 51)
    turtle.showturtle()
 
def main():
    turtle.setup(900, 500)
    page0()
    clear_all()
    page1()
    clear_all()
    page2()
    turtle.done()
main()
【代码附】Python实现简单的7款小程序。 前文 在使用Python的过程中,我最喜欢的就是Python的各种第三方库,能够完成很多操作。 下面带大家做7款各种功能不一样的项目。 闹钟 目的:编写一个创建闹钟的Python脚本。 提示:你可以使用date-time模块创建闹钟,以及playsound库播放声音。 ​​​ 短网址生成器 目的:编写一个Python脚本,使用API缩短给定的URL。 ​​​ 石头剪刀布游戏 目标:创建一个命令行游戏,游戏者可以在石头、剪刀和布之间进行选择,与计算机PK。如果游 阅读详情

相关推荐

VS2022 中 std::mutex 静态初始化陷阱:一次诡异崩溃的排查记录

VS2022中使用std::mutex时遇到的静态初始化陷阱问题。该问题源于VS2022 17.4版本为std::mutex添加constexpr支持后,全局静态初始化可能导致系统资源未就绪时锁失效或崩溃。文章分析了问题现象、影响范围,并提供了解决方案。最后给出了排查清单和核心建议

qq_34552942的博客 961

Python入门练手小程序

Python小程序集锦程序1:数字组合程序2:猜数字程序3:猜时间程序4:判断整数大小 程序1:数字组合 问题描述: 有四个数字:1、2、3、4,能组成多少个互不相同且无重复数字的三位数?各是多少? 问题分析: 可填在百位、十位、个位的数字都是1、2、3、4。组成所有的排列后再去掉不满足条件的排列。 for i in range(1,5): for j in range(1,5): for k in range(1,5): if i!=j and

一个只会写bug的搬运工 2万+

NSFC结题报告下载脚本失效?3步教你手动修复下载按钮问题(2024最新版)

针对NSFC官网域名变更导致结题报告下载脚本失效的问题,本文提供了详细的手动修复指南。通过三步操作,教你如何修改用户脚本的域名匹配规则,恢复下载按钮功能,确保NSFC结题报告下载器能继续高效工作。

vscode6remote的博客 764

40个Python入门小程序

有不少同学学完Python后仍然很难将其灵活运用。我整理 37 个Python入门的小程序。在实践中应用Python会有事半功倍的效果。

yyaannnnnnnn的博客 1万+

基于MuJoCo的六轴机械臂动力学参数辨识全流程详解

在机器人控制领域,动力学模型是轨迹跟踪和力控交互等高级控制算法的基石。其核心原理是通过牛顿-欧拉方程或拉格朗日方程,建立关节力矩与运动状态(位置、速度、加速度)及物理参数(如质量、惯性)之间的数学关系。精确的模型能显著提升控制性能,是实现高精度作业的关键技术价值。在实际应用中,出厂模型参数常存在误差或随负载变化,因此需要通过参数辨识技术进行校准。动力学参数辨识通过设计激励轨迹、采集运动与力矩数据,并利用最小二乘等优化方法反推真实参数。本文以MuJoCo高保真仿真环境为平台,完整演示了从激励轨迹设计、仿真数据

weixin_34212762的博客 497

逆概率加权法(Inverse Probability Weighting, IPW)的原理及R实现

逆概率加权(IPW)是一种用于解释由于非随机选择观测值或人群信息的非随机缺失而造成的缺失和选择偏差的方法。原理:这种方法可以通过对观察值的加权来修正分析,使其具有被选中的概率。IPW是基于这样一个假设,即整个研究人群都有可以预测纳入概率(非遗漏)的个体信息,因此,在考虑到这些信息后,我们可以仅从非遗漏的观察值开始对整个目标人群进行推断。计算的程序如下:首先,我们考虑整个研究人群,用逻辑回归模型计算非失访信息的概率,其中响应是非失访,协变量是其可能的预测因素。每个受试者的权重是由预测概率的倒数给出的。然后使用

Christina 5万+

Python-5个有趣的小程序【每一个都附完整源码】

里面写了5个有趣的小程序(樱花树;呆萌小鸭子;计算器;皮卡丘;表白专用)每一个小程序都附上了运行截图和完整的代码

qiao_yue的博客 1万+

[官方培训]07-UE材质基础 孙丹璐 Epic 笔记

勾选允许自定义深度写入再在模型上勾选然后可以通过Scene Texture节点拿到渲染的自定义深度信息,有了自定义深度信息就可以与当前渲染的像素深度进行对比,自定义深度信息存放的是最靠近我们的深度,如果当前像素离自定义深度比较远我们就不要这个像素。效果如下这种方案的缺点也很明显,因为这样看不到第二层的透明了,如果是两层的半透明的裙摆,这样就看不到第二层的裙摆了。对于半透明排序问题最根本能解决的还是光线追踪,ue5中又加入了OIT(基于像素的排序)。官方透明材质的理解和应用。

Tcohneyn的博客 1574

python制作小程序制作流程,如何用python写小程序

大家好,小编来为大家解答以下问题,python写一个小程序登录脚本,python制作小程序制作流程,今天让我们一起来看看吧!一、申请账号1. 进入根据指引填写信息和提交相应的资料,完成账号申请。如果跳转后页面出现错误,请刷新访问。2. 使用申请的微信公众平台账号登录,单击,可以看到小程序的AppID,请记录AppID,后续操作中需要使用。3. 在中填入您的已备案域名。

pingf123的博客 1194

RC正弦波振荡电路实验全解析:如何通过调节电容电阻改变输出频率

本文深入解析RC正弦波振荡电路,重点阐述如何通过调节电容和电阻来精确改变输出频率。文章从文氏桥振荡电路的核心原理出发,详细介绍了电容粗调频段与电阻微调频率的实操策略,并分析了元件误差、寄生参数等对实测频率的影响,为电路设计与调试提供了从理论到实践的完整指南。

yhn456789的博客 1125

大模型面试题34:Transformer的Encoder和Decoder区别与协作

Encoder:双向自注意力,专注理解输入,输出语义特征;Decoder:掩码自注意力+编码器-解码器注意力,专注生成输出,实现语义对齐。

叫好与叫座虽然不是对立面,但想在同一个作品中达到双重效果很难。 819

python制作小程序制作流程,怎么用python写小程序

range(2, end) 可以生成 2, 3, ... end序列,并依次赋值给 x 执行循环。大家好,小编来为大家解答以下问题,python制作小程序制作流程,怎么用python写小程序,今天让我们一起来看看吧!输入年份,判断是否是闰年。程序随机生成一个正整数,用户来猜,程序根据猜的大小给出相应的提示。>=90分得A,[80, 90) 得B,[70, 80)得C,[60, 70)得D,< 60得E。输入半径,计算圆的半径和面积,圆周长公式:2*π*r,面试公式:π*r^2。输入销售利润,计算奖金。

chatgpt002的博客 836

基于英特尔 RealSense D455 相机实现裂缝尺寸以及深度测量

D455 相机可用于对这些零部件进行高精度的表面检测,快速准确地测量裂缝的尺寸和深度,实现自动化的质量控制和缺陷筛查,提高生产效率和产品质量。D455 相机能够对焊缝表面进行细致扫描,测量焊缝的宽度、深度以及焊缝表面的不规则程度等参数,帮助检测焊缝是否存在缺陷,如未焊透、焊瘤等,为焊接质量的评估和改进提供数据支持。:RGB 传感器采用全局快门,并且其视场与深度视场相匹配,能够提供更出色的 RGB 图像质量,以及深度图像和 RGB 图像之间的更好对应性,从而可提高扫描质量。可以看出宽度和高度都是十分准确的。

qq_53545309的博客 1720
上一篇: python小程序代码50 到100行,python编程100个小程序
下一篇: 用python做简单的小游戏,如何用python写小游戏
www55597
博客等级 码龄3年 8285粉丝 758原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值