解决无限 This file is indented with tabs instead of 4 spaces

本文介绍如何在 IntelliJ IDEA 中设置 Java 代码的缩进风格,包括使用制表符进行代码对齐的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

File -> Settings -> Editor -> Code Style -> Java -> Tabs and Indents -> Use tab character

PS C:\duspider> & 'e:\python\python.exe' 'c:\Users\lenovo\.vscode\extensions\ms-python.debugpy-2025.8.0-win32-x64\bundled\libs\debugpy\launcher' '56924' '--' 'C:\duspider\duspider.py' Traceback (most recent call last): File "e:\python\Lib\runpy.py", line 198, in _run_module_as_main return _run_code(code, main_globals, None, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "e:\python\Lib\runpy.py", line 88, in _run_code exec(code, run_globals) File "c:\Users\lenovo\.vscode\extensions\ms-python.debugpy-2025.8.0-win32-x64\bundled\libs\debugpy\launcher/../..\debugpy\__main__.py", line 71, in <module> cli.main() File "c:\Users\lenovo\.vscode\extensions\ms-python.debugpy-2025.8.0-win32-x64\bundled\libs\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 501, in main run() File "c:\Users\lenovo\.vscode\extensions\ms-python.debugpy-2025.8.0-win32-x64\bundled\libs\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 351, in run_file runpy.run_path(target, run_name="__main__") File "c:\Users\lenovo\.vscode\extensions\ms-python.debugpy-2025.8.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 309, in run_path code, fname = _get_code_from_file(run_name, path_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\lenovo\.vscode\extensions\ms-python.debugpy-2025.8.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 283, in _get_code_from_file code = compile(f.read(), fname, "exec") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\duspider\duspider.py", line 15 print("已完成爬取的章节:") TabError: inconsistent use of tabs and spaces in indentation
05-18
评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值