小学生python游戏编程arcade----精灵调用图片的两种类

news2024/11/25 22:34:27

小学生python游戏编程arcade----精灵调用图片的两种类

    • 前言
    • 精灵调用图片的两种类
      • 1、第一种类的定义
        • 1.1 以文件名及缩放比例做初始参数
        • 1.2 利用变换图片的颜色更换角色的使用
        • 1.3 代码分析
  • 转换文件来不及调用,时间问题??????
      • 2、第二种方法,通过sprite的texture直接赋值
        • 2.1精灵的两种加载图片方式
        • 2.2 两种方式,上述类是一种以文件形赋值的 # 添加角色.
        • 2.3 修改类
        • 2.4 调用第二种类的代码实现
    • 源码获取

前言

接上篇文章继续解绍arcade游戏编程的基本知识。精灵调用图片纹理的两种类的实现,一种直接引用图片文件,一种利用arcade.load_texture的过度,直接给精灵赋值。如上次写的,游戏升级时,通过程序换精灵的颜色,用后种方法定义的类较好。

精灵调用图片的两种类

1、第一种类的定义

1.1 以文件名及缩放比例做初始参数

class Enemy_tank(arcade.Sprite):
    def __init__(self, filename, scale, x, y, speed_to_player=0.2):
        super().__init__(filename, scale)
        self.center_x = x
        self.center_y = y
        self.word = 'book'
        self.hz = '书'
        self.life = 1  # 生命条数,即挨几颗子弹消失
        self.speed_to_player = speed_to_player  # 面向角色移动的速度

    def draw_word(self, x, y, fcolor=arcade.csscolor.WHITE_SMOKE, fsize=18, text=None):
        xs=fsize
        if text:
            arcade.draw_rectangle_filled(x+len(self.word)*xs//2-10,y+5,len(text)*xs,30,(128,138,135))
            arcade.draw_text(text, x, y, fcolor, fsize)

        else:
            arcade.draw_rectangle_filled(x+len(self.word)*xs//2-10,y+5,len(self.word)*xs, 30,(128,138,135))
            arcade.draw_text(self.word, x, y, fcolor, fsize)

    def update(self):
        super().update()
        if self.speed_to_player:
            # 敌人向角色移动变量
            self.change_x = math.cos(self.angle) * 0.2
            self.change_y = math.sin(self.angle) * 0.2

1.2 利用变换图片的颜色更换角色的使用

    def setup_enemy(self):
        # pass
        self.scene.add_sprite_list_after(LAYER_tanks, 'wj')
        if len(self.word_keys) == 0:
            if self.danyuan==len(self.gk[self.year]):
                self.level += 1
                self.year =self.years[self.level]
            else:
                self.danyuan += 1
                self.setup_word(self.danyuan, self.year)

        if len(self.word_keys) > 0:
            self.key = self.word_dict[self.word_keys[0]]  # 朋友
            # print('key',self.key)
            xsword = {}
            xsword[self.word_keys[0]] = self.word_dict[self.word_keys[0]]
            # 随机取3
            sankey = random.sample(self.word_dict.keys(), 3)
            if self.word_keys[0] in sankey:
                sankey.remove(self.word_keys[0])
            # 增加两个敌人
            xsword[sankey[0]] = self.word_dict[sankey[0]]
            xsword[sankey[1]] = self.word_dict[sankey[1]]

            # 增加随机坦克
            posx=[]
            random_x= random.random()*SCREEN_width/3
            for jj in range(3):
                tempx=random_x+400*jj
                if tempx>self.end_of_map:
                    tempx=random.random()*SCREEN_width/2
                posx.append(tempx)
            random_y = random.random() * self.top_of_map / 3
            random.shuffle(posx)  # 打乱顺序
            # print(posx)
            j=0

            # 转换文件来不及调用,时间问题??????
            tempcolorh = random.random()
            # print('color',tempcolorh)
            tempic = change_color_tmpic(Image.open("images/坦克2.png"), tempcolorh)
            tempfile = 'images/temp'+str(tempcolorh)+'.png'
            tempic.save(tempfile)
            for x in xsword:
                tank = Enemy_tank(tempfile, 0.5, posx[j], random_y)
                tank.word = x
                tank.hz = xsword[x]
                self.scene.add_sprite(LAYER_tanks, tank)
                j +=1
            if (os.path.exists(tempfile)):
                # 存在,则删除文件
                os.remove(tempfile)
            # 去掉已显示单词
            self.word_keys.remove(self.word_keys[0])



        # 增加子弹层
        self.scene.add_sprite_list_after(LAYER_bullet, 'wj')
        # 增加爆炸粒子列表
        self.scene.add_sprite_list_after(LAYER_explosions, 'wj')

1.3 代码分析

转换文件来不及调用,时间问题??????

        tempcolorh = random.random()
        # print('color',tempcolorh)
        tempic = change_color_tmpic(Image.open("images/坦克2.png"), tempcolorh)
        tempfile = 'images/temp'+str(tempcolorh)+'.png'
        tempic.save(tempfile)
        for x in xsword:
            tank = Enemy_tank(tempfile, 0.5, posx[j], random_y)
            tank.word = x
            tank.hz = xsword[x]
            self.scene.add_sprite(LAYER_tanks, tank)
            j +=1
        if (os.path.exists(tempfile)):
            # 存在,则删除文件
            os.remove(tempfile)
        # 去掉已显示单词
        self.word_keys.remove(self.word_keys[0])
        此用需要借助临时文件,再生成精灵,中间还遇到个问题,使用tempfile做为过度赋值,结果游戏敌人坦克不变色,最后通过每次生成文件名不同,可以实现效果。

2、第二种方法,通过sprite的texture直接赋值

2.1精灵的两种加载图片方式

通过查看sprite的类的定义原码,如下

class Sprite:
    """
    Class that represents a 'sprite' on-screen. Most games center around sprites.
    For examples on how to use this class, see:
    https://api.arcade.academy/en/latest/examples/index.html#sprites

    :param str filename: Filename of an image that represents the sprite.
    :param float scale: Scale the image up or down. Scale of 1.0 is none.
    :param float image_x: X offset to sprite within sprite sheet.
    :param float image_y: Y offset to sprite within sprite sheet.
    :param float image_width: Width of the sprite
    :param float image_height: Height of the sprite
    :param float center_x: Location of the sprite
    :param float center_y: Location of the sprite
    :param bool flipped_horizontally: Mirror the sprite image. Flip left/right across vertical axis.
    :param bool flipped_vertically: Flip the image up/down across the horizontal axis.
    :param bool flipped_diagonally: Transpose the image, flip it across the diagonal.
    :param str hit_box_algorithm: One of None, 'None', 'Simple' or 'Detailed'.
          Defaults to 'Simple'. Use 'Simple' for the :data:`PhysicsEngineSimple`,
          :data:`PhysicsEnginePlatformer`
          and 'Detailed' for the :data:`PymunkPhysicsEngine`.
    :param Texture texture: Specify the texture directly. 直接指定纹理
    :param float angle: The initial rotation of the sprite in degrees

    This will ignore all hit box and image size arguments.

        .. figure:: ../images/hit_box_algorithm_none.png
           :width: 40%

           hit_box_algorithm = "None"

        .. figure:: ../images/hit_box_algorithm_simple.png
           :width: 55%

           hit_box_algorithm = "Simple"

        .. figure:: ../images/hit_box_algorithm_detailed.png
           :width: 75%

           hit_box_algorithm = "Detailed"

    :param float hit_box_detail: Float, defaults to 4.5. Used with 'Detailed' to hit box

    Attributes:
        :alpha: Transparency of sprite. 0 is invisible, 255 is opaque.
        :angle: Rotation angle in degrees. Sprites rotate counter-clock-wise.
        :radians: Rotation angle in radians. Sprites rotate counter-clock-wise.
        :bottom: Set/query the sprite location by using the bottom coordinate. \
        This will be the 'y' of the bottom of the sprite.
        :boundary_left: Used in movement. Left boundary of moving sprite.
        :boundary_right: Used in movement. Right boundary of moving sprite.
        :boundary_top: Used in movement. Top boundary of moving sprite.
        :boundary_bottom: Used in movement. Bottom boundary of moving sprite.
        :center_x: X location of the center of the sprite
        :center_y: Y location of the center of the sprite
        :change_x: Movement vector, in the x direction.
        :change_y: Movement vector, in the y direction.
        :change_angle: Change in rotation.
        :color: Color tint the sprite
        :collision_radius: Used as a fast-check to see if this item is close \
        enough to another item. If this check works, we do a slower more accurate check. \
        You probably don't want to use this field. Instead, set points in the \
        hit box.
        :cur_texture_index: Index of current texture being used.
        :guid: Unique identifier for the sprite. Useful when debugging.
        :height: Height of the sprite.
        :force: Force being applied to the sprite. Useful when used with Pymunk \
        for physics.
        :hit_box: Points, in relation to the center of the sprite, that are used \
        for collision detection. Arcade defaults to creating a hit box via the \
        'simple' hit box algorithm \
        that encompass the image. If you are creating a ramp or making better \
        hit-boxes, you can custom-set these.
        :left: Set/query the sprite location by using the left coordinate. This \
        will be the 'x' of the left of the sprite.
        :position: A list with the (x, y) of where the sprite is.
        :right: Set/query the sprite location by using the right coordinate. \
        This will be the 'y=x' of the right of the sprite.
        :sprite_lists: List of all the sprite lists this sprite is part of.
        :texture: :class:`arcade.Texture` class with the current texture. Setting a new texture does \
        **not** update the hit box of the sprite. This can be done with \
        ``my_sprite.hit_box = my_sprite.texture.hit_box_points``. New textures will be centered \
        on the current center_x/center_y.
        :textures: List of textures associated with this sprite.
        :top: Set/query the sprite location by using the top coordinate. This \
        will be the 'y' of the top of the sprite.
        :scale: Scale the image up or down. Scale of 1.0 is original size, 0.5 \
        is 1/2 height and width.
        :velocity: Change in x, y expressed as a list. (0, 0) would be not moving.
        :width: Width of the sprite

    It is common to over-ride the `update` method and provide mechanics on
    movement or other sprite updates.
    """

    def __init__(
        self,
        filename: str = None,
        scale: float = 1,
        image_x: float = 0,
        image_y: float = 0,
        image_width: float = 0,
        image_height: float = 0,
        center_x: float = 0,
        center_y: float = 0,
        repeat_count_x: int = 1,  # Unused
        repeat_count_y: int = 1,  # Unused
        flipped_horizontally: bool = False,
        flipped_vertically: bool = False,
        flipped_diagonally: bool = False,
        hit_box_algorithm: Optional[str] = "Simple",
        hit_box_detail: float = 4.5,
        texture: Texture = None,
        angle: float = 0,
    ):
        """ Constructor """
        # Position, size and orientation properties
        self._width: float = 0.0
        self._height: float = 0.0
        self._scale: float = scale
        self._position: Point = (center_x, center_y)
        self._angle = angle
        self.velocity = [0.0, 0.0]
        self.change_angle: float = 0.0

        # Hit box and collision property
        self._points: Optional[PointList] = None
        self._point_list_cache: Optional[PointList] = None
        self._hit_box_shape: Optional[ShapeElementList] = None
        self._hit_box_algorithm = hit_box_algorithm
        self._hit_box_detail = hit_box_detail
        self._collision_radius: Optional[float] = None

        # Color
        self._color: RGB = (255, 255, 255)
        self._alpha: int = 255

        # Custom sprite properties
        self._properties: Optional[Dict[str, Any]] = None

        # Boundaries for moving platforms in tilemaps
        self.boundary_left: Optional[float] = None
        self.boundary_right: Optional[float] = None
        self.boundary_top: Optional[float] = None
        self.boundary_bottom: Optional[float] = None

        # Texture properties
        self._texture: Optional[Texture] = None
        self.textures: List[Texture] = []
        self.cur_texture_index: int = 0

        self.sprite_lists: List["SpriteList"] = []
        self.physics_engines: List[Any] = []
        self._sprite_list: Optional["SpriteList"] = None  # Used for Sprite.draw()

        # Pymunk specific properties
        self._pymunk: Optional[PyMunk] = None
        self.force = [0, 0]

        # Debug properties
        self.guid: Optional[str] = None

        # Sanity check values
        if image_width < 0:
            raise ValueError("Width of image can't be less than zero.")

        if image_height < 0:
            raise ValueError(
                "Height entered is less than zero. Height must be a positive float."
            )

        if image_width == 0 and image_height != 0:
            raise ValueError("Width can't be zero.")

        if image_height == 0 and image_width != 0:
            raise ValueError("Height can't be zero.")

        if hit_box_algorithm not in ["Simple", "Detailed", "None", None]:
            raise ValueError(
                "hit_box_algorithm must be 'Simple', 'Detailed', 'None' or None"
            )

        if texture:
            self._texture = texture
            self._textures = [texture]
            self._width = self._texture.width * scale
            self._height = self._texture.height * scale
        elif filename is not None:
            self._texture = load_texture(
                filename,
                image_x,
                image_y,
                image_width,
                image_height,
                flipped_horizontally=flipped_horizontally,
                flipped_vertically=flipped_vertically,
                flipped_diagonally=flipped_diagonally,
                hit_box_algorithm=hit_box_algorithm,
                hit_box_detail=hit_box_detail,
            )
            self.textures = [self._texture]
            # Ignore the texture's scale and use ours
            self._width = self._texture.width * scale
            self._height = self._texture.height * scale

        if self._texture and not self._points:
            self._points = self._texture.hit_box_points

2.2 两种方式,上述类是一种以文件形赋值的 # 添加角色.

一以文件引用
image_source = “images/bird.png”
self.player_sprite = arcade.Sprite(image_source, CHARACTER_SCALING)
self.player_sprite.center_x = 64
self.player_sprite.center_y = 128
self.player_list.append(self.player_sprite)
二 以texture引用
# 添加角色.
# image_source = “images/bird.png”
texture = arcade.load_texture(f"images/bird.png")
# self.player_sprite = arcade.Sprite(image_source, CHARACTER_SCALING)
self.player_sprite = arcade.Sprite(texture=texture, scale=CHARACTER_SCALING)
self.player_sprite.center_x = 64
self.player_sprite.center_y = 128
self.player_list.append(self.player_sprite)

2.3 修改类

# 不调用文件,直接给texture给值
class Enemy_tank_pic(arcade.Sprite):
    def __init__(self, texture, scale, x, y, speed_to_player=0.2):
        super().__init__(texture=texture, scale=scale)
        self.center_x = x
        self.center_y = y
        self.word = 'book'
        self.hz = '书'
        self.life = 1  # 生命条数,即挨几颗子弹消失
        self.speed_to_player = speed_to_player  # 面向角色移动的速度

    def draw_word(self, x, y, fcolor=arcade.csscolor.WHITE_SMOKE, fsize=18, text=None):
        xs=fsize
        if text:
            arcade.draw_rectangle_filled(x+len(self.word)*xs//2-10,y+5,len(text)*xs,30,(128,138,135))
            arcade.draw_text(text, x, y, fcolor, fsize)

        else:
            arcade.draw_rectangle_filled(x+len(self.word)*xs//2-10,y+5,len(self.word)*xs, 30,(128,138,135))
            arcade.draw_text(self.word, x, y, fcolor, fsize)

    def update(self):
        super().update()
        if self.speed_to_player:
            # 敌人向角色移动变量
            self.change_x = math.cos(self.angle) * 0.2
            self.change_y = math.sin(self.angle) * 0.2



2.4 调用第二种类的代码实现

在这里插入图片描述

            # 转换文件来不及调用,时间问题??????
            tempcolorh = random.random()
            tempic = change_color_tmpic(Image.open("images/坦克2.png"), tempcolorh)
            tempfile = 'images/temp.png'
            tempic.save(tempfile)
            texture = arcade.load_texture(tempfile)
            for x in xsword:
                tank = Enemy_tank_pic(texture, 0.5, posx[j], random_y)
                tank.word = x
                tank.hz = xsword[x]
                self.scene.add_sprite(LAYER_tanks, tank)
                j +=1
            # 去掉已显示单词
            self.word_keys.remove(self.word_keys[0])

问题一样存在
调整如下

            # 转换文件来不及调用,时间问题??????
            tempcolorh = random.random()
            tempic = change_color_tmpic(Image.open("images/坦克2.png"), tempcolorh)
            # tempfile = 'images/temp.png'
            # tempic.save(tempfile)
            # texture = arcade.load_texture(tempfile)
            for x in xsword:
                tank = Enemy_tank_pic(tempic, 0.5, posx[j], random_y)
                tank.word = x
                tank.hz = xsword[x]
                self.scene.add_sprite(LAYER_tanks, tank)
                j +=1
            # 去掉已显示单词
            self.word_keys.remove(self.word_keys[0])

出现问题:

  File "E:\pgame\arcadegame\tank.py", line 135, in __init__
    super().__init__(texture=texture, scale=scale)
  File "E:\pgame\venv\lib\site-packages\arcade\sprite.py", line 274, in __init__
    self._points = self._texture.hit_box_points
  File "E:\pgame\venv\lib\site-packages\PIL\Image.py", line 548, in __getattr__
    raise AttributeError(name)
AttributeError: hit_box_points

源码获取

关注博主后,私聊博主免费获取
需要技术指导,育娃新思考,企业软件合作等更多服务请联系博主

今天是以此模板持续更新此育儿专栏的第35/50次。
可以关注我,点赞我、评论我、收藏我啦。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/42810.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【数据结构初阶】链式二叉树接口实现+痛苦的OJ题

递归心决&#xff1a;(xdm好好感悟) 1.确定递归的结束条件 2.确定递归的单层逻辑 3.确定递归的参数和返回值 文章目录一、链式二叉树接口1.二叉树的结构体2.手动造一棵二叉树3.二叉树前、中、后序遍历(递归的神圣大门开启)4.二叉树的结点个数5.二叉树的叶子结点个数6.二叉树的…

【毕业设计】深度学习动物识别系统 - 图像识别 python OpenCV

文章目录0 前言1 课题背景2 实现效果3 卷积神经网络3.1卷积层3.2 池化层3.3 激活函数&#xff1a;3.4 全连接层3.5 使用tensorflow中keras模块实现卷积神经网络4 inception_v3网络5 最后0 前言 &#x1f525; Hi&#xff0c;大家好&#xff0c;这里是丹成学长的毕设系列文章&a…

Web前端大作业、基于HTML+CSS+JavaScript响应式个人相册博客网站

&#x1f389;精彩专栏推荐&#x1f447;&#x1f3fb;&#x1f447;&#x1f3fb;&#x1f447;&#x1f3fb; ✍️ 作者简介: 一个热爱把逻辑思维转变为代码的技术博主 &#x1f482; 作者主页: 【主页——&#x1f680;获取更多优质源码】 &#x1f393; web前端期末大作业…

【DL with Pytorch】第 1 章 :深度学习与PyTorch简介

&#x1f50e;大家好&#xff0c;我是Sonhhxg_柒&#xff0c;希望你看完之后&#xff0c;能对你有所帮助&#xff0c;不足请指正&#xff01;共同学习交流&#x1f50e; &#x1f4dd;个人主页&#xff0d;Sonhhxg_柒的博客_CSDN博客 &#x1f4c3; &#x1f381;欢迎各位→点赞…

1.每天进步一点点------爬虫应用场景

14天学习训练营导师课程&#xff1a; 杨鑫《Python 自学编程基础》 杨鑫《 Python 网络爬虫基础》 杨鑫《 Scrapy 爬虫框架实战和项目管理》 杨老师推荐自学Python的网站 w3schools 传送门 geeksforgeeks 传送门 realpython 传送门 学习之前读一读 来看看爬虫合不合法 传送…

安洵杯 2022 复现

babyphp 知识点&#xff1a;原生类的利用&#xff0c;session 反序列化<?php //something in flag.phpclass A {public $a;public $b;public function __wakeup(){$this->a "babyhacker";}public function __invoke(){if (isset($this->a) && $t…

[附源码]SSM计算机毕业设计文章管理系统查重PPTJAVA

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

Java 多线程为啥要有ThreadLocal,怎么用,这篇讲全了!

前面我们学习的线程并发时的同步控制&#xff0c;是为了保证多个线程对共享数据争用时的正确性的。那如果一个操作本身不涉及对共享数据的使用&#xff0c;相反&#xff0c;只是希望变量只能由创建它的线程使用&#xff08;即线程隔离&#xff09;就需要到线程本地存储了。 Ja…

艾美捷曲妥珠单抗Trastuzumab化学性质和特异性说明

艾美捷曲妥珠单抗Trastuzumab是人源化IgG1κ单克隆抗体&#xff0c;其以高亲和力选择性结合人表皮生长因子受体2蛋白HER2的细胞外结构域。曲妥珠单抗通过重组DNA技术在哺乳动物细胞&#xff08;中国仓鼠卵巢&#xff09;中产生。 艾美捷曲妥珠单抗Trastuzumab化学性质&#xff…

[附源码]SSM计算机毕业设计鲜花销售管理系统JAVA

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

Set 集合概述与使用

目录 一、概述 1.特点&#xff1a; 2.方法&#xff1a; 二、Set接口的使用 三、Set实现类 1.HashSet *** &#xff08;1&#xff09;简单应用&#xff1a; &#xff08;2&#xff09;存储方式 2.TreeSet &#xff08;1&#xff09;红黑树 &#xff08;2&#xff09…

文件被删除怎么办?恢复数据,电脑小白也能操作!

平时保存文件&#xff0c;我们都会用到电脑、硬盘、U盘。但有时候&#xff0c;不可避免会出现一些状况&#xff0c;比如数据误删&#xff0c;或者格式化。恢复数据应该如何操作&#xff1f;可能你会觉得自己&#xff1a;我是电脑小白&#xff0c;太复杂的操作我不会。别担心下面…

realme手机用什么蓝牙耳机好?2022公认音质最好的蓝牙耳机

作为日常通话、健身、听歌必不可少的设备&#xff0c;蓝牙耳机已经逐渐替代了有线耳机&#xff0c;成为了城市居民日常生活中最常用的收听设备。随着技术的发展&#xff0c;蓝牙耳机的性能也会越来越接近用户的需要&#xff0c;下面分享几款realme手机适用并且音质清晰的蓝牙耳…

mini_batch学习

概念 学习的指标 如何得到所有学习数据的损失函数的总和 一个一个计算&#xff1f;如果数据量大的话&#xff0c;费时费力 太难受了吧 从训练数据中获取小数据mini-batch 对每个小数据进行批量学习 首先读入mnist数据集 import numpy as np# 实现从训练数据中随机选择指定…

uni-app的三种操作数据库方法

目录 前端与后端&#xff08;云端&#xff09;分离实现数据库的操作 1.使用云函数来操作数据库 2.使用云对象来操作数据库 前端与后端&#xff08;云端&#xff09;结合实现客户端操作数据库 3.使用DB Schema结构规范实现客户端对数据库的操作 欢迎大家关注&#xff1a; …

Cinemachine各组件功能介绍

官方Github地址&#xff1a;https://github.com/Unity-Technologies/com.unity.cinemachine/tree/main/com.unity.cinemachine 文档在Documentation~文件夹下。 这里主要介绍各个组件的功能&#xff0c;具体参数设置查阅文档即可。 目录 Brain Camera CinemachineVirtualC…

yolov5训练coco数据集

文章目录参考链接一、coco数据集1. 简介2. 下载3.解压后的数据4. COCO数据集(.json)训练格式转换成YOLO格式(.txt)参考链接 为YOLOv5搭建COCO数据集训练、验证和测试环境 CoCo数据集下载 一、coco数据集 1. 简介 MS COCO的全称是Microsoft Common Objects in Context&#…

前端甘特图组件开发(一)

背景 工作中需要在网页上实现甘特图&#xff0c;以展示进度数据。通过网上调研相关项目&#xff0c;找到一款 dhtmlx-gantt 组件&#xff0c;在低程度上满足项目需求&#xff0c;但在部分定制功能&#xff08;如时间轴自定义、编辑弹窗样式风格等&#xff09;并不能完全满足项…

PyCharm+PyQT5之一环境搭建

TOCPyCharmPyQT之一环境搭建 今天搭建了PyCharmPyQT之一环境&#xff0c;看到好多论坛和书籍在搭建Python环境时仍然不使用虚拟环境管理&#xff0c;这对今后环境的移植和保存是非常麻烦的&#xff0c;大家可以按以下思路管理环境。 1.先安装python3.8.2&#xff08;我用的win7…

【简单、高效、性能好】SetFit:无需Prompts的高效小样本学习

重磅推荐专栏&#xff1a; 《Transformers自然语言处理系列教程》 手把手带你深入实践Transformers&#xff0c;轻松构建属于自己的NLP智能应用&#xff01; 1. 概要 使用预训练语言模型的小样本学习&#xff08;处理只有少量标签或没有标签的数据&#xff09;已成为比较普遍的…