macOS 搭建 Python 环境

macOS 搭建 Python 环境

基于 macOS Catalina Version 10.15.7

使用 brew 安装 Python、 black、pipenv、PyCharm

brew install python black pipenv
brew cask install pycharm

PyCharm 配置 black 自动代码格式化为 pep8 标准

PyCharm --> Preferences --> Tools --> File Watchers --> Add --> <custom>

标签 填充
Name Black(可自定义)
File type Python
Scope Project Files
Program /usr/local/bin/black
Arguments $FilePath$
Output paths to refresh $FilePath$

PyCharm 常用插件

  1. Rainbow Brackets
  2. Grazie
  3. statistic
  4. CodeGlance

Reference

black
Editor integration