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

相关推荐
石头城的小石头8 小时前
【从0到1的鼠标位置显示记录器,基于python环境pycharm下编译实施,最终打包为exe,欢迎交流】
python·目标跟踪·pycharm·计算机外设·鼠标
m沐沐14 小时前
【计算机视觉】OpenCV 模板匹配银行卡数字识别---上
人工智能·后端·python·opencv·计算机视觉·pycharm·numpy
北凉军2 天前
更换PyCharm 任务栏图标
ide·python·pycharm
m沐沐2 天前
【深度学习】PyTorch CNN 手写数字识别(卷积神经网络)
人工智能·pytorch·python·深度学习·机器学习·pycharm·cnn
资深流水灯工程师3 天前
PyCharm 增强插件完整安装与配置指南(PySide6 开发专用)
ide·python·pycharm
雾沉川3 天前
PyCharm 2025.2 完整安装与配置技术教程
ide·python·pycharm
资深流水灯工程师3 天前
PySide6 + Qt Designer + PyCharm 完整开发流程
开发语言·qt·pycharm
郝亚军3 天前
win11安装python3.12.7和pycharm
ide·python·pycharm
资深流水灯工程师3 天前
PyCharm 虚拟环境完整配置指南(PySide6 开发专用)
ide·python·pycharm
Algorithm_Engineer_3 天前
如何利用Pycharm进行分布式的Debug训练
ide·分布式·pycharm