Hopeless windows people can use CygWin. But wouldn't it be better if you used a logging library instead of pure print statements? I'm mainly a java guy (but use python every know and then) and I do know that logging is essential. And not only during development. Every softver may contain bugs, even after you start to use it. Logs help a lot then. And debug level logging will help to find the bug. There's no point in removing the log lines that you inserted during the development (well, usually). Logging should be configured from outside the software, like in java's log4j. There must be something similar for python as well.
It's a matter of lazyness. I have proper logging in some applications but the original reason for adding it was because certain methods were damn complicated with loads and loads of business-logic-conditionals. When the code isn't very complex I find it much more efficient to use print.
Of course, if I would prefer to have the logging there instead but sometimes it's just not the right moment for setting that up. The few times I use print statements are for minor things such as quick bugfixes.
Guess I should copy some of my serious logging stuff into my more matured python projects where I momentarily use print.
But I will keep using print for the little things. I reckon it will save me time in the long run.
Comment
Hopeless windows people can use CygWin. But wouldn't it be better if you used a logging library instead of pure print statements? I'm mainly a java guy (but use python every know and then) and I do know that logging is essential. And not only during development. Every softver may contain bugs, even after you start to use it. Logs help a lot then. And debug level logging will help to find the bug. There's no point in removing the log lines that you inserted during the development (well, usually). Logging should be configured from outside the software, like in java's log4j. There must be something similar for python as well.
Replies
Allow me to disagree...
...and agree.
It's a matter of lazyness. I have proper logging in some applications but the original reason for adding it was because certain methods were damn complicated with loads and loads of business-logic-conditionals. When the code isn't very complex I find it much more efficient to use print.
Of course, if I would prefer to have the logging there instead but sometimes it's just not the right moment for setting that up. The few times I use print statements are for minor things such as quick bugfixes.
Guess I should copy some of my serious logging stuff into my more matured python projects where I momentarily use print.
But I will keep using print for the little things. I reckon it will save me time in the long run.