Remove Python pyc File

in python

Python interpreter在執行的時候會在每個package底下產生__pycache__ folder and .pyc, *.pyo file
一般而言這些file不會進入版本控管所以在.gitigore中通常會有
.py[co], pycache
但以上設定卻會在git branch switch時導致pyc, pyo殘留問題
以下介紹3種方法來處理

Continue reading

django學習筆記

in python

Table of Contents

django學習筆記
隨筆亂記,陸續增加中

Continue reading

PyCharm > Preferences > Project > Project interpreter
choose the python interpreter which contains django

PyCharm > Preferences > Languages & Frameworks > Django
check the Enable Django Support
Django project root: project root path
Settings: project settings.py path
Manage script: manage.py

Comment and share

pip指令筆記

in python

python 3rd library通常會撞到:python_path/lib/python3.4/site-packages

以安裝ipython為例

1
2
3
4
5
6
7
8
9
10
11
12
#安裝/反安裝package
pip install ipython
pip uninstall ipython
#找出ipython安裝在哪
pip show --files ipython
#更新package
pip install --upgrade ipython
#列出哪些package需要更新
pip list --outdated

Comment and share

pyenv指令筆記

in python

MAC底下安裝

記得先裝xcode command line tools
pyenv會裝到/usr/local/opt/pyenv

1
brew install pyenv

修改bash_profile加上

~/.bash_profile
1
eval "$(pyenv init -)"

Continue reading
  • page 1 of 1

Cwza

Hello everyone.
I’m cwza.
Welcome to my blog.


Software Engineer


Taiwan/Taipei