欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Bash & VIM & Python 笔记

程序员文章站 2022-07-14 13:34:56
...

Bash & Vim 笔记

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")
相关标签: python 机器学习