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

相关推荐
JenKinJia1 天前
Pycharm中增加远程服务器解释器无法连接的问题
服务器·pycharm·github
XLYcmy1 天前
pdf论文处理:CSV输出模式
数据库·python·pycharm·pdf·论文·csv·dify
燐妤2 天前
中老年智能健康管理项目
python·ai·pycharm·vue3·fastapi·项目开发·健康
大数据专业的小沉3 天前
解决PyCharm 2024.1 打开项目后持续卡顿,UI 无响应,编辑延迟明显
ide·python·pycharm
郝学胜_神的一滴3 天前
Python 高级编程 027:四大推导式全攻略
python·pycharm
前进再前进4 天前
PyCharm 连接 HPC 时 Path to conda 一直转圈:一次 Remote Development 解决方案记录
pycharm
Swift社区4 天前
Python 开发环境怎么选?PyCharm、VS Code、Trae 谁更适合 AI 开发?
人工智能·python·pycharm
SMF19194 天前
【PyCharm】让 PyCharm 使用 .venv 虚拟环境
ide·python·pycharm
维度攻城狮5 天前
PyCharm 使用 DevContainer 开发:打造一致、隔离、高效的开发环境
ide·python·pycharm·devcontainer
赵广陆5 天前
RAG进阶
pycharm·langchain