Created
February 3, 2014 15:58
-
-
Save sentenza/8786601 to your computer and use it in GitHub Desktop.
Implementing verbose print in a Python script -- http://stackoverflow.com/a/5980173/1977778
This file contains 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
if verbose: | |
def verboseprint(*args): | |
# Print each argument separately so caller doesn't need to | |
# stuff everything to be printed into a single string | |
for arg in args: | |
print arg, | |
else: | |
verboseprint = lambda *a: None # do-nothing function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alternative solution: https://github.com/pypa/virtualenv/blob/develop/virtualenv.py#L644