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,

相关推荐
TOOLS指南8 小时前
pycharm数据可视化【分析成绩】
ide·信息可视化·pycharm
永恒的溪流10 小时前
学生如何申请专业版pycharm
ide·python·pycharm
TOOLS指南10 小时前
使用Pycharm实现数据可视化作品代码-Python应用
python·信息可视化·pycharm
乐园游梦记11 小时前
在pycharm中添加Conda创建的openmmlab虚拟环境作为解释器
ide·pycharm·conda
Word码11 小时前
QQ音乐自动化测试实战指南
python·功能测试·测试工具·pycharm·集成测试
不会编程的-程序猿1 天前
PyCharm 直接把本地项目上传到 GitHub
ide·pycharm·github
在屏幕前出油1 天前
08. ORM——快速开始
数据库·后端·python·sql·pycharm·orm
shughui2 天前
PyCharm 完整教程(旧版本卸载+旧/新版本下载安装+基础使用,2026最新版附安装包)
ide·python·pycharm
深藏功yu名2 天前
大模型推理加速实战技术
人工智能·python·ai·pycharm
江山与紫云2 天前
1.2 配置开发环境(VS Code / PyCharm)
ide·python·elasticsearch·pycharm