摘要: 学习系列,git基本命令记录,开始之前,看下git的工作原理图: 基础命令 git init # 创建本地仓库 git status #查看信息 git add 文件名(*) #将代码提交至暂存区 git commit -m '备注信息' #将代码提交到本地仓库 git diff 文件名 #对比文件 阅读全文
posted @ 2023-04-20 17:47 jasonchenYT 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 异常处理 # 异常处理:处理软件或信息系统中出现的异常 # 语法结构:try--except--else--finally # 下标越界 try: num = int(input('请输入1~4之间的数:')) lista = [1, 2, 3, 4, 5] print(lista[num]) ex 阅读全文
posted @ 2022-09-10 11:28 jasonchenYT 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 封装的实现 # 封装 class people: def __init__(self,name,money): self.name = name self.__money = money # 私有属性,只能类的内部使用--》数据封装 # def __say(self): # # print('我是私 阅读全文
posted @ 2022-09-06 00:28 jasonchenYT 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 文件目录的基本操作 """ @Time : 2022/4/30 15:23 @Author : Jason Chen @File : demo_dir.py @desc : 操作目录 """ import os import shutil # 文件重命名和文件删除 os.rename("./test 阅读全文
posted @ 2022-04-30 16:31 jasonchenYT 阅读(88) 评论(0) 推荐(0) 编辑
摘要: #time的基本使用 import time now = time.time() print(int(now)) now_tuple = time.localtime(now) print(now_tuple) time.sleep(1) # 格式化 now_str = time.strftime( 阅读全文
posted @ 2022-04-30 16:27 jasonchenYT 阅读(36) 评论(0) 推荐(0) 编辑
摘要: 九九乘法表的实现 """ 1 * 1 = 1 1 * 2 = 2 1 * 3 = 3 ... 1 * 9 = 9 """ 代码展示 for j in range(1, 10): for i in range(1, j + 1): # 通过j来控制循环次数 print(f"{i} * {j} = %- 阅读全文
posted @ 2022-04-29 18:41 jasonchenYT 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 选择排序可以对列表进行排序升序/降序可以使用min()/max()函数控制 具体实现查阅如下代码: # 将列表分为有序区域和无需区域 list2 = [21, 32, 43, 23, -21, 34, -100, 200, 300] # 将list2进行升序排序 # 第一次 有序区1 无序区8 mi 阅读全文
posted @ 2022-04-29 14:46 jasonchenYT 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 案例1:查询/home 下的test.txt文件 /home 查询范围 -name 使用名称查询 test.txt 查询文件 find /home -name test.txt 案例2:查询/opt下jasonchen用户的所有文件 /opt 查询范围 -user使用用户查询 jasonchen用户 阅读全文
posted @ 2022-04-20 10:27 jasonchenYT 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 【C:\Users\Jason Chen\Desktop\demo\test.xlsx】为被复制路径下的文件, 【C:\Users\Jason Chen\Desktop\demo\test{i}.xlsx】为生成后路径下的文件。 import shutil for i in range(1, 11) 阅读全文
posted @ 2021-12-21 16:20 jasonchenYT 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 解决方式:检查代理是否或者vpn,我这边是应为打开了charles抓包工具导致的,关闭抓包工具即可正常运行。 阅读全文
posted @ 2021-09-15 14:32 jasonchenYT 阅读(117) 评论(0) 推荐(0) 编辑