摘要: 1.多线程 # -*- coding: utf-8 -*- import threading import time def print_hello_world(): print("hello-world") def concurrent_hello_world(n): threads = [] # 阅读全文
posted @ 2024-10-20 21:39 tt_贝塔 阅读(0) 评论(0) 推荐(0) 编辑
摘要: 1.冒泡排序 def faet_sort(test: list) -> list: """冒泡排序""" for i in range(len(test)): for j in range(len(test)-i-1): if test[j] > test[j + 1]: test[j], test 阅读全文
posted @ 2023-11-16 09:42 tt_贝塔 阅读(53) 评论(0) 推荐(0) 编辑
摘要: ubuntu 20.04 设置 root 默认登录 1. 设置 root 密码 sudo passwd root 2. root 用户编辑 /etc/ssh/sshd_config 文件 vi /etc/ssh/sshd_config 修改前: #PermitRootLogin prohibit-p 阅读全文
posted @ 2023-05-18 09:33 tt_贝塔 阅读(152) 评论(0) 推荐(0) 编辑
摘要: python 实现远程连接,操作linux 1. 安装依赖 pip3 install paramiko 2. 实现原理 # -*- coding: utf-8 -*- import paramiko def connect(cmd, try_times=3): while True: try: # 阅读全文
posted @ 2022-12-21 09:43 tt_贝塔 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 获取项目的的绝对路径(完整路径) 背景:当项目下引用的模块较多时,可通过全局文件路径管理项目 import os def get_root_path(): cwd = os.path.abspath(os.path.dirname(__file__)) root_path = os.path.abs 阅读全文
posted @ 2022-12-10 10:18 tt_贝塔 阅读(67) 评论(0) 推荐(0) 编辑
摘要: python 处理日志 import logging import colorlog import datetime from pathlib import Path """ Loggers:记录器,提供应用程序代码能直接使用的接口; Handlers:处理器,将记录器产生的日志发送至目的地; Fi 阅读全文
posted @ 2022-07-20 23:53 tt_贝塔 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 1. 拉取gitlab镜像,机器配置建议 4C8G docker pull gitlab/gitlab-ce 2. 容器挂载 - 添加配置文件目录 mkdir -p /home/gitlab/etc - 添加日志文件目录 mkdir -p /home/gitlab/log - 添加数据文件目录 mk 阅读全文
posted @ 2022-02-27 21:23 tt_贝塔 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 1.队列基本用法 q=Queue(),若括号中没有指定数量,默认无上限, Queue.qsize(),返回当前队列包含的消息数量; Queue.empty(),如果队列为空,返回True,反之False; Queue.full(),如果队列满了,返回True,反之False; Queue.get([ 阅读全文
posted @ 2021-11-16 20:59 tt_贝塔 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 1. 下载 install.ps1 1. 访问网址:https://chocolatey.org/install.ps1 2. 内容另存为 install.ps1 文件 2. 安装 chocolatey 1. 进入 install.ps1 文件目录 2. cmd 执行:@powershell -No 阅读全文
posted @ 2021-10-16 16:50 tt_贝塔 阅读(471) 评论(0) 推荐(0) 编辑
摘要: 1. windows 查找应用进程 # 查询进程,注意进程名称区分大小写 tasklist | findStr "Postman" # 杀死进程 taskkill /pid "进程ID" # 强制杀死进程 taskkill -F /pid "进程ID" 2. linux/mac 查找应用进程 # 查 阅读全文
posted @ 2021-10-12 09:33 tt_贝塔 阅读(47) 评论(0) 推荐(0) 编辑