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

相关推荐
女神下凡1 天前
PyCharm 2026破解激活
ide·python·pycharm
承渊政道1 天前
【Python编程—从入门到实践】(Python条件判断完全入门:从布尔表达式到列表中的if实战)
开发语言·python·pycharm·条件判断·布尔表达式
小芒果_012 天前
从0到1,将pycharm上的项目上传到github
ide·pycharm·github
ikun_文4 天前
Django框架路由Router的使用
python·pycharm·django
澈如冬雪^5 天前
IDEA导入已经下载的jar包
pycharm·intellij-idea·jar
qq_426003965 天前
UI自动化元素定位不到解决方案
前端·pycharm·自动化
丈剑走天涯5 天前
基于 Python 3 语法的 PyCharm 练习示例,涵盖列表操作、类型判断及数据清洗等核心知识点
windows·python·pycharm
洛兮银儿6 天前
pycharm选中同一个词的标记颜色的修改
ide·python·pycharm
郝学胜_神的一滴6 天前
Effective Python 条款 6:善用拆包告别恼人的下标索引
python·pycharm
2601_962382436 天前
怎么使用pycharm开发图形化界面
pycharm·教程·开发·图形化界面·pyqt5