0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Python でコードの見た目整理とかデバッグのためにインデントしたいメモ

Last updated at Posted at 2022-05-12

コードの見た目を整理したくてブロックをインデントしたい...
デバッグとかでブロックを全部無効にしたり有効にしたりしたい...

C/C++ だとカッコとか #if 0 とかでできるが...


int a = 0;

{
  proc(a);
}

#if 0
  proc(a);
#endif

Python でやる

あんまりいい方法は無いようです. if True くらいでしょうか.

if True:
  ...

if False にすればコード実行されなくなります.

適当にジェネレータークラス作って with 構文ででもできるかもしれません...

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?