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

相关推荐
2601_967987376 天前
pycharm如何运行python代码
pycharm·版本控制·python代码·调试工具·运行环境
Thanks_ks6 天前
【第 006 讲】搭建 PyCharm 开发环境:PyCharm 的下载与安装 | 初始设置与常用配置
ide·python·pycharm·开发工具·jetbrains·开发环境·集成开发环境
汤米粥11 天前
cmd手动创建的Django项目怎么用社区版Pycharm运行起来
python·pycharm·django
fanruitian15 天前
pycharm 使用anaconda
ide·python·pycharm
guocy-ww15 天前
JetBrains 全家桶(IDEA、PyCharm等)合法免费方案 审核中
pycharm·intellij-idea
人工智能导论实践课18 天前
【GUI桌面开发3】PyCharm配置外部工具
ide·python·pycharm
Dev _18 天前
PyCharm旧进程仍在后台运行,导致新实例无法启动或连接
ide·python·pycharm
qq_3660862222 天前
idea项目重新启动时报错找不到jar
pycharm·intellij-idea·jar
1-1=022 天前
Python PyCharm
开发语言·python·pycharm
Time_Memory_cici24 天前
在Windows系统安装Pycharm以及PyTorch方法
pytorch·windows·pycharm