Bash & VIM & Python 笔记
程序员文章站
2022-07-14 13:34:56
...
Bash
- set
~/.bashrc
for intialization - CUDA
CUDA_VISIBLE_DEVICES=0,1,2,3 python3 train.py # use 4 gpus
nvidis-smi
ls /usr/local/cuda # cuda location
- Environment
export LD_LIBRARY_PATH=... # library
export PATH=...
export CPATH=...
- 解/压缩
tar -zvcf #压缩
tar -zvxf #解压
VIM
- Replace yes with no
:%s/yes/no/g # use yes to replace no golbally without confirmation
:%s/yes/no/gd # use yes to replace no golbally, ask confirmation first
Python
- 当要用string代表变量名时
a_0 = 3
print(eval('a_' + str(0)))
- 读wav file
from scipy.io import wavfile
fs, wavinput.= wavfile.read("audio.wav")
- 读FLAC file
import soundfile as sf
wavinput, fs = sf.read("audio.flac")
上一篇: Flink读写Kafka