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 (程永强), \[2\] Google Python Style Guide,

相关推荐
朱一头zcy1 天前
下载安装pycharm 并通过pycahrm来驱动Anaconda来运行Python程序
ide·python·pycharm
影魅周影2 天前
解决mac端pycharm执行allure命令报错:returned non-zero exit status 127
ide·macos·pycharm
洛克大航海3 天前
PyCharm 软件关联 GitHub 账户
ide·pycharm·github
yanxiaoyu1104 天前
Pycharm远程调用Autodl进行训练(关机后不影响)
ide·python·pycharm
云和数据.ChenGuang4 天前
Python 3.14 与 PyCharm 2025.2.1 的调试器(PyDev)存在兼容性问题
开发语言·python·pycharm
怪兽20144 天前
PyCharm如何像其他idea软件跨行选择文本
ide·pycharm·intellij-idea
啾啾啾6665 天前
连接一个新的服务器时,打开PyCharm时报错:报错内容是服务器磁盘或配额满了
python·pycharm
Q_Q5110082855 天前
python+django/flask的美食交流宣传系统vue
spring boot·python·pycharm·django·flask·node.js·php
Q_Q5110082855 天前
python+django/flask+vue的基层智能化人员调度系统pycharm-计算机毕业设计
spring boot·python·pycharm·django·flask·node.js
小明_GLC6 天前
关于新项目在PyCharm中自动构建UV环境的问题
ide·pycharm·uv