• 【腾讯云 Cloud Studio 实战训练营】基于Python实现的快速抽奖系统


    ⭐️ Cloud Studio - 简介

    Cloud Studio 是基于浏览器的集成式开发环境(IDE),为开发者提供了一个永不间断的云端工作站。用户在使用 Cloud Studio 时无需安装,随时随地打开浏览器就能在线编程。Cloud Studio 作为在线 IDE,包含代码高亮、自动补全、Git 集成、终端等 IDE 的基础功能,同时支持实时调试、插件扩展等,可以帮助开发者快速完成各种应用的开发、编译与部署工作。

    详细信息请参考官方文档,点击这里哦:Cloud Studio(云端 IDE)简介 | Cloud Studio

    在这里插入图片描述

    🌟 操作步骤

    点击链接跳转到官网,并点击“注册/登录”,Cloud Studio官网

    🌟 注册Cloud Studio

    • 这里Cloud Studio 提供了三种注册方式:
      • 使用 CODING 账号授权注册/登录
      • 使用微信授权注册/登录(推荐使用微信登陆)
      • 使用 GitHub 授权注册/登录 (若使用 GitHub 登陆则创建公开应用时需要实名认证)

    在这里插入图片描述

    🌟 创建工作空间

    登陆之后我们进入 Cloud Studio社区的主页之后可以点击创建应用,这里有非常多的模版,有兴趣的小伙伴可以在我们实验完成后,对它有了一个基本的认识和熟悉后再去操作。

    在这里插入图片描述
    其实云IDE这种产品,对我来说,最大的好处就是比如我要学习什么语言学习什么框架的话,不用在本地搭建各种开发环境,从而把自己的电脑搞得也许装了很多开发环境,但是用的却没多少个,同时比如不同语言或者相同语言不同版本之间又会出现一些配置问题,导致自己的开发环境受到污染;这个时候云IDE很好的解决了这个问题,想学什么想练什么语言的代码,一键启动即可。

    🌟 启动对应的开发环境

    点击 “完成” 后,环境会自动开始配置,正常情况下大概1-2分钟左右,开发环境就配好了,是不是超级的方便!启动成功后,我们进入了一个欢迎界面。

    在这里插入图片描述

    通过对代码和README的简单解读我们发现,这是一个默认的Flask项目搭建起来的临时页面。

    ⭐️ 抽奖系统项目介绍

    该系统一共有三个模块。

    第一个模块:base 模块,即基础模块。

    该模块实现的功能为:

    • 功能点:

      • 避免业务逻辑,只做底层的相关操作;比如对用户的增删改查,奖品的增删改查(这些功能只是单纯的操作文件,而不是处理复杂的业务逻辑),直接和 storage 模块的关联。(稍后介绍 storage 模块)。
    • 知识点:

      • 父类的创建。
      • son文件的读写,私有函数的定义。
      • 字典的练习,循环的练习。
      • 条件语句的练习。
      • 异常的处理与抛出。

    第二个模块:admin 模块,这是给管理员的模块。

    该模块实现的功能为:

    • 功能点:

      • 继承 base 模块
      • 开发用户的增删改查
      • 开发奖品的增删改查
      • PS:似乎与 base 模块相同,其实不然。admin 模块的 增删改查 是添加业务逻辑处理的,比如满足了某些条件才能够执行修改或删除…
    • 知识点:

      • 类的继承
      • 多态的练习 super 函数
      • 条件语句的练习
      • 循环语句的练习

    第三个功能模块: user 模块,主要实现用户的验证与抽奖操作

    该模块的功能未:

    • 功能点:

      • 用户身份验证
      • 抽奖功能的实现
    • 知识点:

      • 类的继承
      • 父类私有函数的调用
      • 启蒙与强化开发思维

    ⭐️ 抽奖系统代码结构图

    • cloudstudio 中会自动生成一个工作空间,然后我们分别创建 common 包与 storage 包

      • 创建 common 包,在 common 包内分别创建 error.pyconsts.pyutils.py 模块。
      • 创建 storage 包(其实就是个文件夹),创建 user.jsongift.json 分别存储用户信息和奖品信息。
      • 而我们的 base、admin、user 模块则是直接创建在项目根目录下即可,见下图:

      PS:这也是一个比较简单的代码结构。


    在这里插入图片描述


    ⭐️ 项目基础类 - 文件检查

    接下来通过 base.py 来书写基础类,当前要实现的基本功能就是导入 user.json 与 gift.json 进行文件检查

    • 我们需要自定义三个异常类用来判断文件的异常:
      • 1、判断文件地址路径是否存在 —> NotPathError
      • 2、判断文件是否是 json 格式 —> FormatError
      • 3、判断是否是文件 —> NotFileError

    🌟 base.py 基础类文件检查示例如下:

    # coding:utf-8
    
    
    """
        1:导入 user.json ,文件检查
        2:导入 gift.json ,文件检查
    """
    
    
    import os
    from common import error
    
    
    class Base(object):
        def __init__(self, user_json, gift_json):
            self.user_json = user_json
            self.gift_json = gift_json
    
            self.__check_user_json()
            self.__check_gift_json()
    
        def __check_user_json(self):
            if not os.path.exists(self.user_json):  # 判断文件地址路径是否存在
                raise error.NotPathError("not found {} ".format(self.user_json))
    
            if not self.user_json.endswith('.json'):   # 判断文件是否是 json 格式
                raise error.FormatError()
    
            if not os.path.isfile(self.user_json):     # 判断是否是文件
                raise error.NotFileError()
    
        def __check_gift_json(self):
            if not os.path.exists(self.gift_json):  # 判断文件地址路径是否存在
                raise error.NotPathError("not found {} ".format(self.gift_json))
    
            if not self.gift_json.endswith('.json'):  # 判断文件是否是 json 格式
                raise error.FormatError()
    
            if not os.path.isfile(self.gift_json):
                raise error.NotFileError()
    
    
    if __name__ == '__main__':
    
        user_path = os.path.join(os.getcwd(), "storage", "user.json")
        gift_path = os.path.join(os.getcwd(), "storage", "gift.json")
        print(user_path)
        print(gift_path)
    
        base = Base(user_json=user_path, gift_json=gift_path)
        print(base)
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51

    🌟 common 模块 的 error.py 脚本的代码如下:

    # coding:utf-8
    
    
    class NotPathError(Exception):		# 文件路径错误
        def __init__(self, message):
            self.message = message
    
    
    class FormatError(Exception):		# 文件格式后缀错误
        def __init__(self, message="file need json format"):
            self.message = message
    
    
    class NotFileError(Exception):		# 非文件错误
        def __init__(self, message="It's not file"):
            self.message = message
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16

    此时在 base.py 基础模块中我们发现, __check_user_json()__check_gift_json() 函数的基本功能是一样的,都是检查文件。这个时候就可以将其封装为一个公共函数 check_file 用以调用,所以我们可以在 utils.py 模块定义一个 check_file 函数。

    🌟 utils.py 模块 check_file 函数示例如下

    # coding:utf-8
    
    
    import os
    from .error import NotPathError, NotFileError, FormatError
    
    
    def check_file(path):
        if not os.path.exists(path):  # 判断文件地址路径是否存在
            raise NotPathError("not found {} ".format(path))
    
        if not path.endswith('.json'):  # 判断文件是否是 json 格式
            raise FormatError()
    
        if not os.path.isfile(path):  # 判断是否是文件
            raise NotFileError()
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16

    那么此时我们的 base.py 基础模块优化后的脚本代码就如下:

    # coding:utf-8
    
    
    """
        1:导入 user.json ,文件检查
        2:导入 gift.json ,文件检查
    """
    
    
    import os
    from common.utils import check_file
    
    
    class Base(object):
        def __init__(self, user_json, gift_json):
            self.user_json = user_json
            self.gift_json = gift_json
    
            self.__check_user_json()
            self.__check_gift_json()
    
        def __check_user_json(self):
            check_file(self.user_json)
    
        def __check_gift_json(self):
            check_file(self.gift_json)
    
    
    if __name__ == '__main__':
    
        user_path = os.path.join(os.getcwd(), "storage", "user.json")
        gift_path = os.path.join(os.getcwd(), "storage", "gift.json")
        print(user_path)
        print(gift_path)
    
        base = Base(user_json=user_path, gift_json=gift_path)
        print(base)
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37

    执行结果如下:


    在这里插入图片描述


    尝试做几个文件异常的判断:


    在这里插入图片描述


    ⭐️ base用户相关功能实现

    base.py 模块基础上,增加 __read_users()__write_user() 函数。

    所以接下来,我们就实现一下前三个目标。

    # coding:utf-8
    
    
    """
        1:导入 user.json ,文件检查
        2:导入 gift.json ,文件检查
        *************************
        3、确定用户表中每个用户的信息字段
    	4、读取 `user.json` 文件
    	5、写入 `user.json` 文件(检测该用户是否存在),存在则不可写入
    """
    
    
    import os
    import json
    import time
    
    from common.utils import check_file
    from common.error import UserExistsError
    
    
    class Base(object):
        def __init__(self, user_json, gift_json):
            self.user_json = user_json
            self.gift_json = gift_json
    
            self.__check_user_json()
            self.__check_gift_json()
    
        def __check_user_json(self):    # 调用 utils 模块的公共函数 check_file 检查 user.json 文件
            check_file(self.user_json)
    
        def __check_gift_json(self):    # 调用 utils 模块的公共函数 check_file 检查 gift.json 文件
            check_file(self.gift_json)
    
        def __read_user(self):          # 读取 user.json 文件
            with open(self.user_json) as f:
                data = json.loads(f.read())
            return data
    
        def __write_user(self, **user):     # 写入用户信息(进行写入时的判断)
            if "username" not in user:
                raise ValueError("missing username")    # 缺少 username 信息
            if "role" not in user:
                raise ValueError("missing role")        # 缺少角色信息(缺少权限信息)
    
            user['active'] = True       # 初始化用户基础信息
            user['create_time'] = time.time()
            user['update_time'] = time.time()
            user['gifts'] = []
    
            users = self.__read_user()      # 读取 user.json
    #        print(users)		# 打印输出 users 是为了调试
    #        return				# 打印输出调试 users ,return 是为了不在执行后面的代码
            if user['username'] in users:   # 判断用户信息是否存在,如果存在则抛出 'error.py' 模块自定义的 UserExistsError
                raise UserExistsError('username {} had existe'.format(user['username']))
    
            users.update(
                {user['username']: user}
            )
    
            json_users = json.dumps(users)
            with open(self.user_json, 'w') as f:
                f.write(json_users)
    
    
    if __name__ == '__main__':
    
        user_path = os.path.join(os.getcwd(), "storage", "user.json")
        gift_path = os.path.join(os.getcwd(), "storage", "gift.json")
        print(user_path)
        print(gift_path)
    
        base = Base(user_json=user_path, gift_json=gift_path)
        print(base)
    
        base.write_user(username='Neo', role='admin')
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78

    🌟 将 时间戳 封装为 utils.py 模块的一个公共函数

    # coding:utf-8
    
    
    import os
    import time
    from .error import NotPathError, NotFileError, FormatError
    
    
    def timestamp_to_string(timestamp):
        time_obj = time.localtime(timestamp)    # 将传入的时间戳实例化成一个时间对象
        time_str = time.strftime('%Y-%m-%d %H:%M:%S ', time_obj)
        return time_str
    
    
    def check_file(path):
        if not os.path.exists(path):  # 判断文件地址路径是否存在
            raise NotPathError("not found %s " % path)
    
        if not path.endswith('.json'):  # 判断文件是否是 json 格式
            raise FormatError()
    
        if not os.path.isfile(path):  # 判断是否是文件
            raise NotFileError()
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23

    🌟 对 base.py 模块中的 __read_user() 进行修改

    # coding:utf-8
    
    
    """
        1:导入 user.json ,文件检查
        2:导入 gift.json ,文件检查
        *************************
        3、确定用户表中每个用户的信息字段
    	4、读取 `user.json` 文件
    	5、写入 `user.json` 文件(检测该用户是否存在),存在则不可写入
    	******************************************************
    """
    
    
    import os
    import json
    import time
    
    from common.utils import check_file, timestamp_to_string
    from common.error import UserExistsError
    
    
    class Base(object):
        def __init__(self, user_json, gift_json):
            self.user_json = user_json
            self.gift_json = gift_json
    
            self.__check_user_json()
            self.__check_gift_json()
    
        def __check_user_json(self):    # 调用 utils 模块的公共函数 check_file 检查 user.json 文件
            check_file(self.user_json)
    
        def __check_gift_json(self):    # 调用 utils 模块的公共函数 check_file 检查 gift.json 文件
            check_file(self.gift_json)
    
        def __read_user(self, time_to_str=True):   # 读取 user.json 文件;
                                                    # timestamp_to_string 修改为 True 时时间戳为可读的格式(调试)
            with open(self.user_json, 'r') as f:
                data = json.loads(f.read())
    
            if time_to_str == True:
                for username, t in data.items():
                    t['create_time'] = timestamp_to_string(t['create_time'])
                    # print(t['create_time'])       # 打印输出时间格式是否改为 可读的 "%Y-%m-%d %H:%M:%S" 格式
                    t['update_time'] = timestamp_to_string(t['update_time'])
                    data[username] = t
                print(data)       # 调试打印输出 __read_user() 的用户信息
    
            return data
    
        def write_user(self, **user):     # 写入用户信息(进行写入时的判断)
            if "username" not in user:
                raise ValueError("missing username")    # 缺少 username 信息
            if "role" not in user:
                raise ValueError("missing role")        # 缺少角色信息(缺少权限信息)
    
            user['active'] = True       # 初始化用户基础信息
            user['create_time'] = time.time()
            user['update_time'] = time.time()
            user['gifts'] = []
    
            users = self.__read_user()      # 读取 user.json
            print(users)		# 打印输出 users 是为了调试
            return				# 打印输出调试 users ,return 是为了不在执行后面的代码
            if user['username'] in users:   # 判断用户信息是否存在,如果存在则抛出 'error.py' 模块自定义的 UserExistsError
                raise UserExistsError('username {} had existe'.format(user['username']))
    
            users.update(
                {user['username']: user}
            )
    
            json_users = json.dumps(users)
            with open(self.user_json, 'w') as f:
                f.write(json_users)
    
            print(users)    # 调试打印输出 users 的用户信息
    
    
    if __name__ == '__main__':
    
        user_path = os.path.join(os.getcwd(), "storage", "user.json")
        gift_path = os.path.join(os.getcwd(), "storage", "gift.json")
        print(user_path)
        print(gift_path)
    
        base = Base(user_json=user_path, gift_json=gift_path)
    
        base.write_user(username='Neo', role='admin')
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89

    这里将代码中的如下两行取消注释,且将 def __read_user(self, time_to_str=False) 改为 def __read_user(self, time_to_str=True)可以看到调试的 读取文件时,时间戳变为 "%Y-%m-%d %H:%M:%S" 的时间格式

            # print(users)		# 打印输出 users 是为了调试
            # return				# 打印输出调试 users ,return 是为了不在执行后面的代码
    #*******************************************************************************
            print(users)		# 打印输出 users 是为了调试
            return				# 打印输出调试 users ,return 是为了不在执行后面的代码
    
    • 1
    • 2
    • 3
    • 4
    • 5

    ⭐️ base 模块 - 用户的修改与删除

    接下来我们继续对 base.py 模块关于 user.json 文件进行相关的操作,同样是三个目标。

    1、对于某个用户 role 权限的修改(或者说是身份的修改) __change_role() 函数

    2、对于 acitve 用户的活跃度的修改

    3、delete_user 删除某个用户的修改


    PS:以上三个函数,依然是 base 类的内置函数;大家可能会有个疑问,为什么现在使用的一些函数都是内置函数呢?原因是未来我们开发 "admin"、"user" 相关类的时候,会覆盖或包裹这些内置函数在它们的外层进行业务相关的开发


    • 用户信息的字段:
      • username:姓名
      • role:角色(normal 或 admin)
      • active:活跃度(身份是否有效:True or False)
      • create_time:创建时间(timestamp)
      • update_time:更新时间(timestamp)
      • gifts:奖品列表(用以存储用户抽到了哪些奖品)
    • 用户信息存储格式:(字典)
      • username:{username, role, active}

    先来编写 __change_role() 函数

    # coding:utf-8
    
    
    """
        1:导入 user.json ,文件检查    "__check_user_json() 函数"
        2:导入 gift.json ,文件检查    "__check_gift_json() 函数"
        *******************************************************
        3、确定用户表中每个用户的信息字段
    	4、读取 `user.json` 文件         "__read_users() 函数"
    	5、写入 `user.json` 文件(检测该用户是否存在),存在则不可写入;"__write_user() 函数" ,这里方便调试,先使用 write_user()
    	***********************************************************************************************************
    	6、对于某个用户 `role` 权限的修改(或者说是身份的修改) `__change_role() 函数`; 同样方便调试,先使用 change_role()
    	7、对于 acitve 用户的活跃度的修改; `__change_acitve() 函数`; 
        8、delete_user 删除某个用户的修改
        ***********************************************************************************************************
    """
    
    
    
    import os
    import json
    import time
    
    from common.consts import ROLES
    from common.error import UserExistsError, RoleError, UserNameNotExist
    from common.utils import check_file, timestamp_to_string
    
    
    class Base(object):
        def __init__(self, user_json, gift_json):
            self.user_json = user_json
            self.gift_json = gift_json
    
            self.__check_user_json()
            self.__check_gift_json()
    
        def __check_user_json(self):    # 调用 utils 模块的公共函数 check_file 检查 user.json 文件
            check_file(self.user_json)
    
        def __check_gift_json(self):    # 调用 utils 模块的公共函数 check_file 检查 gift.json 文件
            check_file(self.gift_json)
    
        def __read_users(self, time_to_str=False):   # 读取 user.json 文件;
                                                    # timestamp_to_string 修改为 True 时时间戳为可读的格式(调试)
            with open(self.user_json, 'r') as f:
                data = json.loads(f.read())
    
            if time_to_str == True:
                for username, t in data.items():
                    t['create_time'] = timestamp_to_string(t['create_time'])
                    # print(t['create_time'])       # 打印输出时间格式是否改为 可读的 "%Y-%m-%d %H:%M:%S" 格式
                    t['update_time'] = timestamp_to_string(t['update_time'])
                    data[username] = t
                print(data)       # 调试打印输出 __read_user() 的用户信息
    
            return data
    
        def write_user(self, **user):     # 写入用户信息(进行写入时的判断)
            if "username" not in user:
                raise ValueError("missing username")    # 缺少 username 信息
            if "role" not in user:
                raise ValueError("missing role")        # 缺少角色信息(缺少权限信息)
    
            user['active'] = True       # 初始化用户基础信息
            user['create_time'] = time.time()
            user['update_time'] = time.time()
            user['gifts'] = []
    
            users = self.__read_users()      # 读取 user.json
            # print(users)		# 打印输出 users 是为了调试
            # return				# 打印输出调试 users ,return 是为了不在执行后面的代码
            if user['username'] in users:   # 判断用户信息是否存在,如果存在则抛出 'error.py' 模块自定义的 UserExistsError
                raise UserExistsError('username {} had existe'.format(user['username']))
    
            users.update(
                {user['username']: user}
            )
    
            json_users = json.dumps(users)
            with open(self.user_json, 'w') as f:
                f.write(json_users)
    
            print(users)    # 调试打印输出 users 的用户信息
    
    
        def change_role(self, username, role):    # 定义修改用户 role 信息函数
            users = self.__read_users()		# 获取当前所有用户信息
            user = users.get(username)		# 根据传入的 username 获取该用户的信息
            if not user:            # 判断用户是否存在 user.json 文件内,若不合法则抛出自定义 "error.py" 模块的 UserNameNotExist 异常
                raise UserNameNotExist('username \'{}\' not exist'.format(username))
    
            if role not in ROLES:   # 判断用户角色信息是否合法,若不合法则抛出自定义 "error.py" 模块的 RoleError 异常
                                    # "consts.py" 模块的 "ROLES"的值是写死的: ROLES = ['admin', 'normal']
                raise RoleError('not use role {}'.format(role))
    
            user['role'] = role
            user['update_time'] = time.time()
            users[username] = user
    
            json_data = json.dumps(users)       # 将 change_role 更新后的内容写入 user_json 文件
            with open(self.user_json, 'w') as f:
                f.write(json_data)
            print(json_data)
    
            return '\'{}\' 的 \'role\' 信息已变更为 \'{}\''.format(user['username'], user['role'])
    
    
    
    if __name__ == '__main__':
    
        user_path = os.path.join(os.getcwd(), "storage", "user.json")
        gift_path = os.path.join(os.getcwd(), "storage", "gift.json")
        print(user_path)
        print(gift_path)
    
        base = Base(user_json=user_path, gift_json=gift_path)
    
        # base.write_user(username='Neo', role='admin')
    
        result = base.change_role(username='Neo', role='normal')
        print(result)
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121

    运行结果如下:

    在这里插入图片描述

    ⭐️ 体验与感受

    关于这个小项目的具体细节,暂时就不做了,总的来说这次的体验让我模拟了在一台新的机器设备上,从 0 到 1 体验Cloud Studio云 IDE 给我们带来的优势,不需要装各种环境,简单易用,开箱即可上手。

    腾讯云 Cloud Studio 提供了一个方便的在线开发平台,让开发者可以在云端进行开发工作,而无需在本地安装和配置开发环境。Cloud Studio 提供了丰富的开发工具和功能,如代码编辑器、终端、调试工具等,同时也支持与腾讯云其他服务的集成,方便开发者进行云上应用的开发和部署。

    总之,Cloud Studio 操作简单、功能强大,希望这个产品能够越做越好。也欢迎大家一起探索 Cloud Studio 更多的功能,为工作中进行赋能!

  • 相关阅读:
    【Flask+gunicorn+ supervisor】部署python项目
    CentOS7安装配置Kafka3.2.0(含SpringBoot连接测试)
    DOM 事件流(事件捕获和事件冒泡)
    四十二、《大数据项目实战之用户行为分析》多框架整合实时分析用户行为日志数据流
    浅谈安科瑞ADL系列导轨式多功能仪表在迪拜楼宇EMS中的应用
    arcPy与添加 shp 文件(显示在 ArcMap),通过Arcpy打开mxd文档并添加数据的方式
    所有社区工作者!能救一个是一个
    前端面试宝典React篇05 如何设计 React 组件?
    数据分析实战应用案例精讲-【应用篇】词云分析(附实战案例)
    第六节:Word中对象的层次结构
  • 原文地址:https://blog.csdn.net/weixin_42250835/article/details/132225209