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

相关推荐
ikun_文2 天前
Python进阶—函数编程
python·pycharm
这就是佬们吗2 天前
Python入门⑤-异常处理、文件操作与实战项目
开发语言·数据库·python·算法·pycharm
今心上2 天前
关于d2l中train_ch3以及softmax中图在pycharm中显示不出来的解决方案
深度学习·机器学习·pycharm
郝学胜_神的一滴3 天前
Python 高级编程 025:二分利器bisect模块:优雅维系有序序列,极致优化检索性能
python·pycharm
这就是佬们吗3 天前
Python入门③-运算符、条件与循环
开发语言·数据库·vscode·python·pycharm·编辑器
赶紧写完去睡觉3 天前
Anaconda 创建虚拟环境与使用
python·pycharm·conda
荡神咩4 天前
windows系统使用glm将claude接入PyCharm2026
pycharm·api
m0_617493944 天前
PyCharm 新手避坑指南:一文解决“项目列表消失”与“模块导入报错”两大玄学问题
ide·python·pycharm
承渊政道4 天前
【Python学习】(了解使用库、标准库、第三方库以及综合案例实操)
python·学习·pycharm·标准库·第三方库·使用库·综合案例
迷途呀6 天前
conda使用指南
python·深度学习·机器学习·pycharm·conda