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,

相关推荐
小白学大数据12 小时前
高并发场景下:平衡搜索引擎收录与爬虫流量负载方案
爬虫·搜索引擎·pycharm
林姜泽樾1 天前
python入门第四课,运算符、转义字符和文本
python·pycharm
-To be number.wan1 天前
PyCharm接入DeepSeek全教程|3种方法+避坑指南
python·学习·pycharm
Chase_______2 天前
【2026最新保姆级】Python 安装与PyCharm安装配置指南 (Window版)
开发语言·python·pycharm
在屏幕前出油3 天前
06. FastAPI——中间件
后端·python·中间件·pycharm·fastapi
WHS-_-20223 天前
LDM代码学习日记
ide·python·pycharm
zzwq.3 天前
Anaconda创建虚拟环境以及与pycharm关联
python·pycharm
不懒不懒4 天前
安装python3.9.7和pycharm-community-2022.3.2.exe以及linux
linux·ide·python·pycharm
飞翔的烤鸡翅4 天前
Kilo Code在PyCharm上的一些实践
ide·python·pycharm·ai编程·kilo code
深藏功yu名4 天前
Day25:RAG检索+重排序保姆级入门!
人工智能·ai·pycharm·agent·rag·rerank