大雜燴總有一款適合你,持續更新
pip換源下載
當在cmd中下載很慢的時候,利用清華源下載會提速。
具體操作如下:
pip install --upgrade --ignore-installed tensorflow
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade --ignore-installed tensorflow
增加 -i https://pypi.tuna.tsinghua.edu.cn/simple
指定TensorFlow下載的版本:
conda install --channel https://conda.anaconda.org/anaconda tensorflow=1.6.0
conda install tensorflow-gpu==1.13.*
查看tensorflow的GPU是否可用
import tensorflow as tf
tf.test.is_gpu_available()
python2轉python3的正則表達式
直接查找 print\s+(.*?)$替換爲 print($1)
Linux下查看隱藏文件
ls -al
Linux下查看和更改git的username
# 查看
git config user.name
# 修改
git config --global user.name "Your name"
Pycharm中三引號函數註釋失效的解決辦法
Setting>>Tools>>python Integrated Tools>>Docstring format>>reStructuredText
jupyter notebook中的函數幫助查看
shift+tab
獲取當前運行的python程序的文件名
import sys
cur_file_name = sys.argv[0]
vim顯示行號
:set nu 或者:set number
刪除多行
xdd
如:刪除10行
10dd
查看Linux的發行版本信息
cat /etc/os-release