python> No #ifdef> Another solution> __debug__ Pros and cons of using

test.py


#ifdef MACRO

print "debug..."

#endif

I want to write code like this and hide it in some cases.

http://stackoverflow.com/questions/12524570/how-do-you-implement-ifdef-in-python Looking at it, it seems that python doesn't have a preprocessor.

Some have suggested using __debug__ instead, while others are against it.

Recommended Posts

python> No #ifdef> Another solution> __debug__ Pros and cons of using
Progate's pros and cons
Pros and cons of converting Django's development environment to Docker
Reconstruction of cone beam CT (CBCT) using python and TIGRE
python: Basics of using scikit-learn ①
Python debug and test module
Source installation and installation of Python
Aligning scanned images of animated video paper using OpenCV and Python
Get and set the value of the dropdown menu using Python and Selenium
Environment construction of python and opencv
The story of Python and the story of NaN
Image capture of firefox using python
Benefits and examples of using RabbitMq
Installation of SciPy and matplotlib (Python)
Authentication using tweepy-User authentication and application authentication (Python)
Removal of haze using Python detailEnhanceFilter
This and that of python properties
Clustering and visualization using Python and CytoScape
Implementation of desktop notifications using Python
(Python) ABC162-D Consideration log and solution
Coexistence of Python2 and 3 with CircleCI (1.0)
Summary of Python indexes and slices
Reputation of Python books and reference books
Development and deployment of REST API in Python using Falcon Web Framework
Get and estimate the shape of the head using Dlib and OpenCV with python