Created
July 4, 2024 07:28
-
-
Save AnurajBhaskar47/c6127ffa27dc88aca41377678bd66d6c to your computer and use it in GitHub Desktop.
python debug statement for a loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import sys | |
| if not os.path.exists('debug.log'): | |
| with open('debug.log', 'w') as sys.stdout: | |
| print('**** print debug') | |
| else: | |
| with open('debug.log', 'a') as sys.stdout: | |
| print('**** pring debug') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment