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

相关推荐
qq_366086221 天前
idea项目重新启动时报错找不到jar
pycharm·intellij-idea·jar
1-1=01 天前
Python PyCharm
开发语言·python·pycharm
Time_Memory_cici3 天前
在Windows系统安装Pycharm以及PyTorch方法
pytorch·windows·pycharm
不像程序员的程序媛4 天前
maven基础
python·pycharm·maven
golang学习记4 天前
Python vs Go:2026年到底该怎么选
java·vscode·python·golang·pycharm·goland
GPU实战笔记8 天前
PyCharm 接云 GPU:远端项目连接与远程解释器别混为一谈
python·pycharm·ssh·远程开发·云gpu
运维@小兵10 天前
安装Pycharm并破解
ide·python·pycharm
承渊政道11 天前
【Python编程—从入门到实践】(让程序记得、恢复并解释失败:Python 文件、异常与JSON系统教程)
开发语言·python·pycharm·json·异常处理
西柚不烦恼11 天前
PyCharm 虚拟环境与 Jenkins 自动化部署实践
pycharm·自动化·jenkins
陈年老古董11 天前
PyQt5 入门指南:环境搭建、PyCharm 外部工具配置与登录界面实战
开发语言·qt·pycharm