etu*_*rdu 0 python commenting indentation
有时我需要临时注释掉块标题以进行测试,例如:
i = 2
s = { 'a', 'b', 'c' }
#while i > 0:
s.pop()
i -= 1
print(s)
Run Code Online (Sandbox Code Playgroud)
但是,由于缩进是python语法的一部分,如果我运行上面的代码,我得到:
s.pop()
^
IndentationError: unexpected indent
Run Code Online (Sandbox Code Playgroud)
我知道对注释中的代码进行dedenting while会使它工作,但是我想保留代码的可视化结构,而不是每次都进行dedenting和缩进.
有什么技巧可以做到这一点吗?
| 归档时间: |
|
| 查看次数: |
508 次 |
| 最近记录: |