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自动将制表符转换为空格
基础教程推荐
- pyserial - 可以从线程 a 写入串行端口,是否阻塞从线程 b 读取? 2022-01-01
- 由Python将MP3转换为MIDI(类型错误:无法加载插件:mtg-Melodia:Melodia) 2022-01-01
- 与常规 dict 相比,Python manager.dict() 非常慢 2022-01-01
- numpy float:比算术运算中内置的慢 10 倍? 2022-01-01
- 尝试制作WhatsApp机器人 2022-01-01
- 使用生成器和迭代器时 Python 多循环失败 2022-01-01
- 将 x 轴刻度更改为自定义字符串 2022-01-01
- 在 Celery 工作人员中捕获 Heroku SIGTERM 以优雅地关 2022-01-01
- 用 Python 编写 Fortran 无格式文件 2022-01-01
- Discord.py 缺少必需的参数 2022-01-01
