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,

相关推荐
X1A0RAN2 小时前
解决Pycharm中部分文件或文件夹被隐藏不展示问题
ide·python·pycharm
数智工坊9 小时前
PyCharm 运行 Python 脚本总自动进 Test 模式?附 RT-DETRv2 依赖缺失终极排坑
开发语言·ide·人工智能·python·pycharm
SilentSamsara1 天前
运算符重载:让自定义对象支持 +、[]、in 操作
开发语言·python·算法·青少年编程·pycharm
我叫张小白。1 天前
PyCharm 集成 Git 与 Gitee
git·pycharm·gitee
VIV-2 天前
Pycharm项目上传到Github
ide·pycharm·github
小李不困还能学2 天前
PyCharm2025.2下载安装配置保姆级教程
python·pycharm
yueping23 天前
运行jar文件报错jar中没有主清单属性在idea里面怎么解决
pycharm·intellij-idea·jar
星越华夏4 天前
msvcrt库在pycharm中运行监控键盘操作无效解决办法
ide·python·pycharm
yuhuofei20214 天前
【Python入门】Python与PyCharm的安装
开发语言·python·pycharm