python迷宫小游戏大全_Python迷宫小游戏源代码、源程序

Python迷宫小游戏源程序包括两个文件maze.py和mazeGenerator.py,mazeGenerator.py实现迷宫地图的生成,程序运行截图:

89118758b793efbcc320b155733f18a7.png

mazeGenerator.py

import numpy as npimport randomimport copyclass UnionSet(object):    """    并查集实现,构造函数中的matrix是一个numpy类型    """    def __init__(self, arr):        self.parent = {pos: pos for pos in arr}        self.count = len(arr)    def find(self, root):        if root == self.parent[root]:            return root        return self.find(self.parent[root])    def union(self, root1, root2):        self.parent[self.find(root1)] = self.find(root2)class Maze(object):    """    迷宫生成类    """    def __init__(self, width=11, height=11):        assert width >= 5 and height >= 5, "Length of width or height must be larger than 5."        self.width = (width // 2) * 2 + 1        self.height = (height // 2) * 2 + 1        self.start = [1, 0]        self.destination = [self.height - 2, self.width - 1]        self.matrix = None        self.path = []    def print_matrix(self):        matrix = copy.deepcopy(self.matrix)        for p in self.path:            matrix[p[0]][p[1]] = 1        for i in range(self.height):            for j in range(self.width):                if matrix[i][j] == -1:                    print('□', end='')                elif matrix[i][j] == 0:                    print('  ', end='')                elif matrix[i][j] == 1:                    print('■', end='')            print('')    def generate_matrix_dfs(self):        # 地图初始化,并将出口和入口处的值设置为0        self.matrix = -np.ones((self.height, self.width))        self.matrix[self.start[0], self.start[1]] = 0        self.matrix[self.destination[0], self.destination[1]] = 0        visit_flag = [[0 for i in range(self.width)] for j in range(self.height)]        def check(row, col, row_, col_):            temp_sum = 0            for d in [[0, 1], [0, -1], [1, 0], [-1, 0]]:                temp_sum += self.matrix[row_ + d[0]][col_ + d[1]]            return temp_sum <= -3        def dfs(row, col):            visit_flag[row][col] = 1            self.matrix[row][col] = 0            if row == self.start[0] and col == self.start[1] + 1:                return            directions = [[0, 2], [0, -2], [2, 0], [-2, 0]]            random.shuffle(directions)            for d in directions:                row_, col_ = row + d[0], col + d[1]                if row_ > 0 and row_ < self.height - 1 and col_ > 0 and col_ < self.width - 1 and visit_flag[row_][                    col_] == 0 and check(row, col, row_, col_):                    if row == row_:                        visit_flag[row][min(col, col_) + 1] = 1                        self.matrix[row][min(col, col_) + 1] = 0                    else:                        visit_flag[min(row, row_) + 1][col] = 1                        self.matrix[min(row, row_) + 1][col] = 0                    dfs(row_, col_)        dfs(self.destination[0], self.destination[1] - 1)        self.matrix[self.start[0], self.start[1] + 1] = 0    # 虽然说是prim算法,但是我感觉更像随机广度优先算法    def generate_matrix_prim(self):        # 地图初始化,并将出口和入口处的值设置为0        self.matrix = -np.ones((self.height, self.width))        def check(row, col):            temp_sum = 0            for d in [[0, 1], [0, -1], [1, 0], [-1, 0]]:                temp_sum += self.matrix[row + d[0]][col + d[1]]            return temp_sum < -3        queue = []        row, col = (np.random.randint(1, self.height - 1) // 2) * 2 + 1, (                    np.random.randint(1, self.width - 1) // 2) * 2 + 1        queue.append((row, col, -1, -1))        while len(queue) != 0:            row, col, r_, c_ = queue.pop(np.random.randint(0, len(queue)))            if check(row, col):                self.matrix[row, col] = 0                if r_ != -1 and row == r_:                    self.matrix[row][min(col, c_) + 1] = 0                elif r_ != -1 and col == c_:                    self.matrix[min(row, r_) + 1][col] = 0                for d in [[0, 2], [0, -2], [2, 0], [-2, 0]]:                    row_, col_ = row + d[0], col + d[1]                    if row_ > 0 and row_ < self.height - 1 and col_ > 0 and col_ < self.width - 1 and self.matrix[row_][                        col_] == -1:                        queue.append((row_, col_, row, col))        self.matrix[self.start[0], self.start[1]] = 0        self.matrix[self.destination[0], self.destination[1]] = 0    # 递归切分算法,还有问题,现在不可用    def generate_matrix_split(self):        # 地图初始化,并将出口和入口处的值设置为0        self.matrix = -np.zeros((self.height, self.width))        self.matrix[0, :] = -1        self.matrix[self.height - 1, :] = -1        self.matrix[:, 0] = -1        self.matrix[:, self.width - 1] = -1        # 随机生成位于(start, end)之间的偶数        def get_random(start, end):            rand = np.random.randint(start, end)            if rand & 0x1 == 0:                return rand            return get_random(start, end)        # split函数的四个参数分别是左上角的行数、列数,右下角的行数、列数,墙壁只能在偶数行,偶数列        def split(lr, lc, rr, rc):            if rr - lr < 2 or rc - lc < 2:                return            # 生成墙壁,墙壁只能是偶数点            cur_row, cur_col = get_random(lr, rr), get_random(lc, rc)            for i in range(lc, rc + 1):                self.matrix[cur_row][i] = -1            for i in range(lr, rr + 1):                self.matrix[i][cur_col] = -1            # 挖穿三面墙得到连通图,挖孔的点只能是偶数点            wall_list = [                ("left", cur_row, [lc + 1, cur_col - 1]),                ("right", cur_row, [cur_col + 1, rc - 1]),                ("top", cur_col, [lr + 1, cur_row - 1]),                ("down", cur_col, [cur_row + 1, rr - 1])            ]            random.shuffle(wall_list)            for wall in wall_list[:-1]:                if wall[2][1] - wall[2][0] < 1:                    continue                if wall[0] in ["left", "right"]:                    self.matrix[wall[1], get_random(wall[2][0], wall[2][1] + 1) + 1] = 0                else:                    self.matrix[get_random(wall[2][0], wall[2][1] + 1), wall[1] + 1] = 0            # self.print_matrix()            # time.sleep(1)            # 递归            split(lr + 2, lc + 2, cur_row - 2, cur_col - 2)            split(lr + 2, cur_col + 2, cur_row - 2, rc - 2)            split(cur_row + 2, lc + 2, rr - 2, cur_col - 2)            split(cur_row + 2, cur_col + 2, rr - 2, rc - 2)            self.matrix[self.start[0], self.start[1]] = 0            self.matrix[self.destination[0], self.destination[1]] = 0        split(0, 0, self.height - 1, self.width - 1)    # 最小生成树算法-kruskal(选边法)思想生成迷宫地图,这种实现方法最复杂。    def generate_matrix_kruskal(self):        # 地图初始化,并将出口和入口处的值设置为0        self.matrix = -np.ones((self.height, self.width))        def check(row, col):            ans, counter = [], 0            for d in [[0, 1], [0, -1], [1, 0], [-1, 0]]:                row_, col_ = row + d[0], col + d[1]                if row_ > 0 and row_ < self.height - 1 and col_ > 0 and col_ < self.width - 1 and self.matrix[                    row_, col_] == -1:                    ans.append([d[0] * 2, d[1] * 2])                    counter += 1            if counter <= 1:                return []            return ans        nodes = set()        row = 1        while row < self.height:            col = 1            while col < self.width:                self.matrix[row, col] = 0                nodes.add((row, col))                col += 2            row += 2        unionset = UnionSet(nodes)        while unionset.count > 1:            row, col = nodes.pop()            directions = check(row, col)            if len(directions):                random.shuffle(directions)                for d in directions:                    row_, col_ = row + d[0], col + d[1]                    if unionset.find((row, col)) == unionset.find((row_, col_)):                        continue                    nodes.add((row, col))                    unionset.count -= 1                    unionset.union((row, col), (row_, col_))                    if row == row_:                        self.matrix[row][min(col, col_) + 1] = 0                    else:                        self.matrix[min(row, row_) + 1][col] = 0                    break        self.matrix[self.start[0], self.start[1]] = 0        self.matrix[self.destination[0], self.destination[1]] = 0    # 迷宫寻路算法dfs    def find_path_dfs(self, destination):        visited = [[0 for i in range(self.width)] for j in range(self.height)]        def dfs(path):            visited[path[-1][0]][path[-1][1]] = 1            if path[-1][0] == destination[0] and path[-1][1] == destination[1]:                self.path = path[:]                return            for d in [[0, 1], [0, -1], [1, 0], [-1, 0]]:                row_, col_ = path[-1][0] + d[0], path[-1][1] + d[1]                if row_ > 0 and row_ < self.height - 1 and col_ > 0 and col_ < self.width and visited[row_][                    col_] == 0 and self.matrix[row_][col_] == 0:                    dfs(path + [[row_, col_]])        dfs([[self.start[0], self.start[1]]])if __name__ == '__main__':    maze = Maze(51, 51)    maze.generate_matrix_kruskal()    maze.print_matrix()    maze.find_path_dfs(maze.destination)    print("answer", maze.path)    maze.print_matrix()

maze.py

import tkinter as tkfrom Maze.mazeGenerator import Mazeimport copyimport mathdef draw_cell(canvas, row, col, color="#F2F2F2"):    x0, y0 = col * cell_width, row * cell_width    x1, y1 = x0 + cell_width, y0 + cell_width    canvas.create_rectangle(x0, y0, x1, y1, fill=color, outline=color, width=0)def draw_path(canvas, matrix, row, col, color, line_color):    # 列    if row + 1 < rows and matrix[row - 1][col] >= 1 and matrix[row + 1][col] >= 1:        x0, y0 = col * cell_width + 2 * cell_width / 5, row * cell_width        x1, y1 = x0 + cell_width / 5, y0 + cell_width    # 行    elif col + 1 < cols and matrix[row][col - 1] >= 1 and matrix[row][col + 1] >= 1:        x0, y0 = col * cell_width, row * cell_width + 2 * cell_width / 5        x1, y1 = x0 + cell_width, y0 + cell_width / 5    # 左上角    elif col + 1 < cols and row + 1 < rows and matrix[row][col + 1] >= 1 and matrix[row + 1][col] >= 1:        x0, y0 = col * cell_width + 2 * cell_width / 5, row * cell_width + 2 * cell_width / 5        x1, y1 = x0 + 3 * cell_width / 5, y0 + cell_width / 5        canvas.create_rectangle(x0, y0, x1, y1, fill=color, outline=line_color, width=0)        x0, y0 = col * cell_width + 2 * cell_width / 5, row * cell_width + 2 * cell_width / 5        x1, y1 = x0 + cell_width / 5, y0 + 3 * cell_width / 5    # 右上角    elif row + 1 < rows and matrix[row][col - 1] >= 1 and matrix[row + 1][col] >= 1:        x0, y0 = col * cell_width, row * cell_width + 2 * cell_width / 5        x1, y1 = x0 + 3 * cell_width / 5, y0 + cell_width / 5        canvas.create_rectangle(x0, y0, x1, y1, fill=color, outline=line_color, width=0)        x0, y0 = col * cell_width + 2 * cell_width / 5, row * cell_width + 2 * cell_width / 5        x1, y1 = x0 + cell_width / 5, y0 + 3 * cell_width / 5    # 左下角    elif col + 1 < cols and matrix[row - 1][col] >= 1 and matrix[row][col + 1] >= 1:        x0, y0 = col * cell_width + 2 * cell_width / 5, row * cell_width        x1, y1 = x0 + cell_width / 5, y0 + 3 * cell_width / 5        canvas.create_rectangle(x0, y0, x1, y1, fill=color, outline=line_color, width=0)        x0, y0 = col * cell_width + 2 * cell_width / 5, row * cell_width + 2 * cell_width / 5        x1, y1 = x0 + 3 * cell_width / 5, y0 + cell_width / 5    # 右下角    elif matrix[row - 1][col] >= 1 and matrix[row][col - 1] >= 1:        x0, y0 = col * cell_width, row * cell_width + 2 * cell_width / 5        x1, y1 = x0 + 3 * cell_width / 5, y0 + cell_width / 5        canvas.create_rectangle(x0, y0, x1, y1, fill=color, outline=line_color, width=0)        x0, y0 = col * cell_width + 2 * cell_width / 5, row * cell_width        x1, y1 = x0 + cell_width / 5, y0 + 3 * cell_width / 5    else:        x0, y0 = col * cell_width + 2 * cell_width / 5, row * cell_width + 2 * cell_width / 5        x1, y1 = x0 + cell_width / 5, y0 + cell_width / 5    canvas.create_rectangle(x0, y0, x1, y1, fill=color, outline=line_color, width=0)def draw_maze(canvas, matrix, path, moves):    """    根据matrix中每个位置的值绘图:    -1: 墙壁    0: 空白    1: 参考路径    2: 移动过的位置    """    for r in range(rows):        for c in range(cols):            if matrix[r][c] == 0:                draw_cell(canvas, r, c)            elif matrix[r][c] == -1:                draw_cell(canvas, r, c, '#525288')            elif matrix[r][c] == 1:                draw_cell(canvas, r, c)                draw_path(canvas, matrix, r, c, '#bc84a8', '#bc84a8')            elif matrix[r][c] == 2:                draw_cell(canvas, r, c)                draw_path(canvas, matrix, r, c, '#ee3f4d', '#ee3f4d')    for p in path:        matrix[p[0]][p[1]] = 1    for move in moves:        matrix[move[0]][move[1]] = 2def update_maze(canvas, matrix, path, moves):    canvas.delete("all")    matrix = copy.copy(matrix)    for p in path:        matrix[p[0]][p[1]] = 1    for move in moves:        matrix[move[0]][move[1]] = 2    row, col = movement_list[-1]    colors = ['#525288', '#F2F2F2', '#525288', '#F2F2F2', '#525288', '#F2F2F2', '#525288', '#F2F2F2']    if level > 2:        colors = ['#232323', '#252525', '#2a2a32', '#424242', '#434368', '#b4b4b4', '#525288', '#F2F2F2']    for r in range(rows):        for c in range(cols):            distance = (row - r) * (row - r) + (col - c) * (col - c)            if distance >= 100:                color = colors[0:2]            elif distance >= 60:                color = colors[2:4]            elif distance >= 30:                color = colors[4:6]            else:                color = colors[6:8]            if matrix[r][c] == 0:                draw_cell(canvas, r, c, color[1])            elif matrix[r][c] == -1:                draw_cell(canvas, r, c, color[0])            elif matrix[r][c] == 1:                draw_cell(canvas, r, c, color[1])                draw_path(canvas, matrix, r, c, '#bc84a8', '#bc84a8')            elif matrix[r][c] == 2:                draw_cell(canvas, r, c, color[1])                draw_path(canvas, matrix, r, c, '#ee3f4d', '#ee3f4d')def check_reach():    global next_maze_flag    if movement_list[-1] == maze.destination:        print("Congratulations! You reach the goal! The step used: {}".format(click_counter))        x0, y0 = width / 2 - 200, 30        x1, y1 = x0 + 400, y0 + 40        canvas.create_rectangle(x0, y0, x1, y1, fill='#F2F2F2', outline='#525288', width=3)        canvas.create_text(width / 2, y0 + 20,                           text="Congratulations! You reach the goal! Steps used: {}".format(click_counter),                           fill="#525288")        next_maze_flag = Truedef _eventHandler(event):    global movement_list    global click_counter    global next_maze_flag    global level    if not next_maze_flag and event.keysym in ['Left', 'Right', 'Up', 'Down']:        click_counter += 1        windows.title("Maze Level-{} Steps-{}".format(level, click_counter))        cur_pos = movement_list[-1]        ops = {'Left': [0, -1], 'Right': [0, 1], 'Up': [-1, 0], 'Down': [1, 0]}        r_, c_ = cur_pos[0] + ops[event.keysym][0], cur_pos[1] + ops[event.keysym][1]        if len(movement_list) > 1 and [r_, c_] == movement_list[-2]:            movement_list.pop()            while True:                cur_pos = movement_list[-1]                counter = 0                for d in [[0, 1], [0, -1], [1, 0], [-1, 0]]:                    r_, c_ = cur_pos[0] + d[0], cur_pos[1] + d[1]                    if c_ >= 0 and maze.matrix[r_][c_] == 0:                        counter += 1                if counter != 2:                    break                movement_list.pop()        elif r_ < maze.height and c_ < maze.width and maze.matrix[r_][c_] == 0:            while True:                movement_list.append([r_, c_])                temp_list = []                for d in [[0, 1], [0, -1], [1, 0], [-1, 0]]:                    r__, c__ = r_ + d[0], c_ + d[1]                    if c__ < maze.width and maze.matrix[r__][c__] == 0 and [r__, c__] != cur_pos:                        temp_list.append([r__, c__])                if len(temp_list) != 1:                    break                cur_pos = [r_, c_]                r_, c_ = temp_list[0]        update_maze(canvas, maze.matrix, maze.path, movement_list)        check_reach()    elif next_maze_flag:        next_maze_flag = False        movement_list = [maze.start]        click_counter = 0        maze.generate_matrix_kruskal()        maze.path = []        draw_maze(canvas, maze.matrix, maze.path, movement_list)        level += 1def _paint(event):    x, y = math.floor((event.y - 1) / cell_width), math.floor((event.x - 1) / cell_width)    if maze.matrix[x][y] == 0:        maze.find_path_dfs([x, y])        update_maze(canvas, maze.matrix, maze.path, movement_list)def _reset(event):    maze.path = []    update_maze(canvas, maze.matrix, maze.path, movement_list)if __name__ == '__main__':    # 基础参数    cell_width = 20    rows = 30    cols = 44    height = cell_width * rows    width = cell_width * cols    level = 1    click_counter = 0    next_maze_flag = False    windows = tk.Tk()    windows.title("迷宫小游戏")    canvas = tk.Canvas(windows, background="#F2F2F2", width=width, height=height)    canvas.pack()    maze = Maze(cols, rows)    movement_list = [maze.start]    maze.generate_matrix_kruskal()    draw_maze(canvas, maze.matrix, maze.path, movement_list)    canvas.bind("", _paint)    canvas.bind("", _reset)    canvas.bind_all("", _eventHandler)    windows.mainloop() 

程序运行过程中遇到问题请在文末留言。

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

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

相关文章

NoSQL最新现状和趋势:云NoSQL数据库将成重要增长引擎

NoSQL最早起源于1998年&#xff0c;但从2009年开始&#xff0c;NoSQL真正开始逐渐兴起和发展。回望历史应该说NoSQL数据库的兴起&#xff0c;完全是十年来伴随互联网技术&#xff0c;大数据数据的兴起和发展&#xff0c;NoSQL在面临大数据场景下相对于关系型数据库运用&#xf…

详谈ARM架构与ARM内核发展史

戳蓝字“CSDN云计算”关注我们哦&#xff01;作者 | 架构师技术联盟责编 | 阿秃1、ARM架构与ARM内核1.1 ARM架构与内核简述目前为止&#xff0c;ARM总共发布8种架构&#xff1a;ARMv1、ARMv2、ARMv3、ARMv4、ARMv5、ARMv6、ARMv7 、ARMv8&#xff0c;这是ARM架构指令集的多个v版…

DMN结合bpmn简化流程_07

项目地址&#xff1a;https://gitee.com/lwj/flowable.git 分支flowable-base 视频地址&#xff1a;https://www.bilibili.com/video/av79774697/ DMN集成到BPMN中使用 简化流程&#xff0c;让我们的BPMN显得更加优雅 * DMN集成bpmn使用 新建决策树模板 注意一定要部署&…

阿里云RPA(机器人流程自动化)干货系列之一:认识RPA(上)

本文是阿里云RPA&#xff08;机器人流程自动化&#xff09;干货系列的开山之作&#xff0c;全面、详细的剖析了RPA的基本概念、给企业带来的价值点以及RPA的优劣势分析。 一、什么是RPA&#xff1f; 人类社会进入21世纪的第一个十年之后&#xff0c;全球企业大都面临着两个严峻…

linux pip3使用清华源_Linux实战016:Ubuntu搭建python开发环境

我们在安装Ubuntu系统的时候会自带安装python2.7和python3.6版本的Python解释器&#xff0c;直接执行"ptyhon"默认运行的是python2.7&#xff0c;只有执行"python3"时才会运行python3.6版本。Python解释器默认安装在/usr/bin目录下&#xff0c;但是Ubuntu并…

编写一个C程序,实现以下功能:定义一个学生结构体Student(含学号、姓名、年龄、身高)和一个函数sort(struct Student *p),该函数使用选择排序法按年龄由小到大排序。在主函数中

编写一个C程序&#xff0c;实现以下功能&#xff1a; 定义一个学生结构体Student(含学号、姓名、年龄、身高)和一个函数sort(struct Student *p)&#xff0c;该函数使用选择排序法按年龄由小到大排序。在主函数中输入10个学生的学号、姓名、年龄和身高&#xff0c;调用sort函数…

在抖音上刷到AI程序员的工资条后,我笑了,别吹了!

2020年&#xff0c;程序员会怎么样&#xff1f;A与B &#xff0c;薪酬与前景程序员与远方2017年~2018年&#xff0c;是人工智能大火的时候。你会发现&#xff0c;跟朋友聊天不谈人工智能&#xff0c;聊天的bigger都上不去。作为一个前景明朗的朝阳行业&#xff0c;高薪吸引&…

C++面向对象思想 两条直线交点计算

我相信哪怕一点光&#xff0c;也能驱散学习中的迷雾&#xff0c;我在这分享一点自己的挫见 思路&#xff1a; 这题最大的难点就是abc三个常数要怎么去构造&#xff0c;这里需要数学公式去推导&#xff0c;虽然是初中水平&#xff0c;也能体现编程和数学密不可分了。因为我之后…

K8s 实践 | 如何解决多租户集群的安全隔离问题?

戳蓝字“CSDN云计算”关注我们哦&#xff01;作者 | 匡大虎责编 | 阿秃导读&#xff1a;如何解决多租户集群的安全隔离问题是企业上云的一个关键问题&#xff0c;本文主要介绍 Kubernetes 多租户集群的基本概念和常见应用形态&#xff0c;以及在企业内部共享集群的业务场景下&a…

scara机器人dh参数表_两分钟带你了解机器人标定的因素

为什么机器人需要标定&#xff1f;影响机器人本体精度因素分为两大类&#xff1a;运动学因素——加工误差、机械公差/装配误差、减速器精度、减速器空程等&#xff1b;动力学因素——质量、惯性张量、摩擦力、关节柔性、连杆柔性。机器人本体的实际精度和理论设计模型可能会存在…

Git的3大区域

为什么使用git&#xff1f; 为了保存文件的每一个历史记录&#xff0c;以便查看每一个历史节点的文件变动情况和把错误的的历史节点回滚。 git分为3个区域&#xff0c;工作区、暂存区、版本库(本地)。 工作区包括git已经管理的文件区域和新增以及修改的文件区域 暂存区&#x…

python编辑学生分数_python处理excel(04)数据筛选和过滤

源数据&#xff0c;我们最终要找出年龄在18——30岁之间&#xff0c;分数大于85分的学生&#xff0c;为A类学生。在excel里可以使用筛选功能&#xff0c;先筛选age列&#xff0c;大于等于、小于。这两个条件限制。然后选score后边的小三角&#xff0c;条件为大于等于85.最终数据…

如何打通“鱼塘” ?腾讯启动“SaaS技术联盟” 共建技术中台

戳蓝字“CSDN云计算”关注我们哦&#xff01;作者 | 刘丹出品 | CSDN云计算&#xff08;ID&#xff1a;CSDNcloud&#xff09;“SaaS企业迎来了最好的时代。一方面&#xff0c;产业互联网大潮已至&#xff0c;中国企业降本增效的需求提升&#xff1b;另一方面&#xff0c;云计算…

Git 回滚

文章目录1. 简述2. 命令版本3. idea 图形化版本(场景1)4. idea 图形化版本(场景2)1. 简述 Git 回滚&#xff1a;常见的有2种场景&#xff0c;第一种是回滚到之前版本&#xff0c;第二种是回滚到之后的版本。 2. 命令版本 用到的命令&#xff1a; 场景1(回滚之前的版本)&…

python开两个守护线程_python 守护线程

守护线程 如果python线程是守护线程&#xff0c;那么以为着这个线程是“不重要”的&#xff0c;“不重要”意味着如果他的父进程结束了但该守护线程没有运行完&#xff0c;守护进程就会被强制结束。如果线程是非守护线程&#xff0c;那么父进程只有等到守护线程运行完毕后才能结…

Nutanix企业云助力嘉里大通提升核心竞争力

Nutanix&#xff08;纳斯达克代码&#xff1a;NTNX&#xff09;近日宣布&#xff0c;物流行业领导企业嘉里大通 (Kerry EAS) 已采用Nutanix超融合基础架构&#xff08;HCI&#xff09;和企业云解决方案&#xff0c;进行企业数据中心的现代化改造。 尽管面临全球贸易和区内经济…

SoapUI 测试http接口实战

文章目录1. New SOAP project2. New TestSuite3. New TestCase4. Add HTTP Request5. 配置请求参数信息6. 选择请求报文类型1. New SOAP project 1&#xff09;打开soapui–>右键Projects–>New SOAP project 2. New TestSuite 3. New TestCase 4. Add HTTP Request …

Git开发流程和工作流

开发流程&#xff1a; C2版本基于C1版本开发&#xff1b;C3版本基于C2版本开发&#xff1b; C4版本基于C3版本开发&#xff1b;C5版本基于C3版本开发&#xff1b; C6 是C4和C3合并后的版本 分支3个总览&#xff1a; 主分支、bug分支、新功能分支 Git修改变动分析&#xff1a;…

AI 安全在阿里业务中的实践,你了解吗?

我们知道&#xff0c;AI 技术将在很长一段时间占据互联网技术时代的风口。但是&#xff0c;有代码的地方就有缺陷&#xff0c;提到技术很难不讲安全&#xff0c;那么AI会不会碰到安全问题呢&#xff1f; AI安全 试想一下&#xff0c;未来的某个早晨&#xff0c;当你像往常一样…

解决idea修改html、js、css后,浏览器不能同步加载

重装了IDEA后&#xff0c;忽略了一些设置&#xff0c;导致在开发springboot项目时&#xff0c;启动了项目&#xff0c;修改了前端文件&#xff0c;但是浏览器中并不能实时加载修改的内容。 主要是IDEA的2个地方需要设置&#xff1a; 一、修改file-settings 二、在IDEA中&…