PyCharm 设置 Tabs and Indents

PyCharm 设置 Tabs and Indents

  • [1. Tabs and Indents](#1. Tabs and Indents)
  • [2. Show whitespaces](#2. Show whitespaces)
  • [3. Google Python Style Guide - 3.4 Indentation](#3. Google Python Style Guide - 3.4 Indentation)
  • References

1. Tabs and Indents

File -> Settings -> Editor -> Code Style -> Python

2. Show whitespaces

3. Google Python Style Guide - 3.4 Indentation

https://google.github.io/styleguide/pyguide.html

Indent your code blocks with 4 spaces.

Never use tabs. Implied line continuation should align wrapped elements vertically, or use a hanging 4-space indent. Closing (round, square or curly) brackets can be placed at the end of the expression, or on separate lines, but then should be indented the same as the line with the corresponding opening bracket.

使用 4 个空格缩进代码块,永远不要用 Tabs。

References

1 Yongqiang Cheng (程永强), https://yongqiang.blog.csdn.net/

2 Google Python Style Guide, https://google.github.io/styleguide/pyguide.html

相关推荐
zzzzzz31010 天前
当产品经理说这个很简单:我用Python自动化处理奇葩需求的实战指南
python·pycharm·产品经理
你是个什么橙17 天前
Python入门学习1:安装配置开发环境——Python或Annaconda,Pycharm
python·学习·pycharm
m沐沐17 天前
【计算机视觉】OpenCV 模板匹配银行卡数字识别---下
人工智能·python·opencv·计算机视觉·pycharm·numpy
某人辛木18 天前
Web自动化测试
前端·python·pycharm·pytest
木囧19 天前
PyCharm手动创建虚拟环境
ide·python·pycharm
FBI HackerHarry浩20 天前
修改Pycharm2023.2.5连接数据库创建的SQL文件保存的默认位置
python·pycharm
dust_and_stars20 天前
Ubuntu 24.04 使用 Snap 安装 code-server、CLion、PyCharm、JetBrains Toolbox 完整教程
ubuntu·pycharm
daly52020 天前
PyCharm怎么下载?2026最新版PyCharm安装教程(Windows/macOS/Linux)
windows·macos·pycharm
承渊政道20 天前
【从零开始大模型开发与微调:基于PyTorch与ChatGLM】(从环境搭建到第一个训练闭环:PyTorch2.0深度学习入门实战)
人工智能·pytorch·深度学习·机器学习·语言模型·自然语言处理·pycharm