pycharm convert tabs to spaces automatically(pycharm自动将制表符转换为空格)
问题描述
我正在使用 pycharm IDE 进行 python 开发,它对于 django 代码工作得非常好,因此怀疑将制表符转换为空格是默认行为,但是在 python IDE 中到处都会出错,因为它不能自动将制表符转换为空格.实现这一目标的方法.
I am using pycharm IDE for python development it works perfectly fine for django code so suspected that converting tabs to spaces is default behaviour, however in python IDE is giving errors everywhere because it can't convert tabs to spaces automatically is there a way to achieve this.
推荐答案
将代码样式更改为使用空格而不是制表符:
Change the code style to use spaces instead of tabs:
然后在项目视图中选择一个你想要转换的文件夹并使用Code |重新格式化代码.
Then select a folder you want to convert in the Project View and use Code | Reformat Code.
这篇关于pycharm自动将制表符转换为空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:pycharm自动将制表符转换为空格
- YouTube API v3 返回截断的观看记录 2022-01-01
- ";find_element_by_name(';name';)";和&QOOT;FIND_ELEMENT(BY NAME,';NAME';)";之间有什么区别? 2022-01-01
- CTR 中的 AES 如何用于 Python 和 PyCrypto? 2022-01-01
- 我如何透明地重定向一个Python导入? 2022-01-01
- 使用公司代理使Python3.x Slack(松弛客户端) 2022-01-01
- 我如何卸载 PyTorch? 2022-01-01
- 检查具有纬度和经度的地理点是否在 shapefile 中 2022-01-01
- 使用 Cython 将 Python 链接到共享库 2022-01-01
- 计算测试数量的Python单元测试 2022-01-01
- 如何使用PYSPARK从Spark获得批次行 2022-01-01
