pycharm自动将制表符转换为空格 [英] pycharm convert tabs to spaces automatically

查看:40
本文介绍了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自动将制表符转换为空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆