主页
Python
Python tabnanny 模块
demo_ref_module_tabnanny_error
运行 ❯
×
更改方向
保存代码
更改主题
import tabnanny import tempfile with tempfile.NamedTemporaryFile(mode='w', suffix='.py', delete=False) as f: f.write('def greet():\n print("Hello")\n print("World")\n') fname = f.name try: tabnanny.check(fname) print('No indentation errors found') except tabnanny.NannyNag as e: print(f'Indentation error: {e}')
Indentation error: unindent does not match any outer indentation level