问题背景
python项目debug起不来
解决方案: 1.设置launch.json
python{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "load_app",
"type": "debugpy",
"request": "launch",
"program": "项目路径/server/server.py",
"console": "integratedTerminal"
}
]
}

相关信息
有时我们可能会在提交后,意识到有些修改需要进行调整或者添加,这时候就可以使用git commit –amend命令来完成
首先我们第一次提交
jsgit init
git add test.txt
git commit -m "Initial commit"
git push
现在,我们意识到我们在提交前漏掉了一个感叹号。我们可以通过以下命令来修改最新的一次提交:
jsecho "Hello, Git!" > test.txt
git add test.txt
git commit --amend -m "Initial commit!"
提示
以下内容的目的,只是为了学习合法的知识
作用
通过使用Context,可以做到统一的、全链路的流程控制和数据传递。
golangctx=context.WithValue(ctx,"my_key","my_value") // 设置一个值
ctx,cancel:=context.WithCancel(context.Background()) //设置一个取消信号
ctx,cancel:=context.WithTimeout(context.Background(),1*time.Second) // 设置一个超时取消信号
cancel()
日常中可能存在文件中包含空行的问题,针对该类问题,可以通过grep或者sed等命令进行整理
grep -v '^$' 原始文件 > 结果文件
Redis 不是整个程序只有一个线程,而是“核心命令执行”主要是单线程
也就是说,客户端发来的 GET、SET、HGET、ZADD 等命令,在 Redis 主线程中按顺序执行。
因为 Redis 的主要操作都在内存中完成,不需要频繁磁盘 IO
单线程的好处
text多个客户端连接 ↓ IO 多路复用监听事件 ↓ Redis 主线程读取请求 ↓ 单线程执行命令 ↓ 返回结果
import os import pandas as pd files = os.listdir( '文件目录路径') # 使用glob匹配所有csv文件 csv_files = [f for f in files if f.endswith('.csv')] for file in csv_files: tmp = "文件目录路径" + file df = pd.read_csv(tmp, sep='\t')