Trying to reply to your original comment "@dideler @zxiiro This is a debug output. Are you suggesting that for future debug print, I should instread log them to a file. After I finish the debuging, do I need to remove these logs?" but I can't find it so replying here.

Debug output is _always_ good, in fact your debug output should be more descriptive, simply "has input" or "doesn't have input" is too generic and isn't helpful. What are you trying to accomplish here and what's the debug message trying to help you figure out?

Python makes it incredibly easy to include logging in your app. Using another project of mine as an  example:

    https://github.com/Yasibo/yasibo/blob/basicbot/yasibo/core.py

You can get logging by importing the logging module then declaring a logger name, python best practices states you should use __name__ as your logger name so that it's obvious which module is issuing the log. Then you can simply log by calling one of:

log.info("msg")
log.warn("msg)
log.error("msg")
log.critical("msg")
log.debug("msg")

Example:

<pre>
import logging
log = logging.getLogger(__name__)

log.info("This is an info log")
log.warn("This is a warning log")
log.error("This is an error log")
log.critical("This is a critical log")
log.debug("This is a debug log")
</pre>

Anytime you think you need debug logs to help you figure out a problem, that means that log is likely useful for someone else in the future if they run into a similar problem so it's best to just code it as a proper debug log. Removing your debug tests after you fix your problem is a waste of effort in my opinion as someone else will have to recode it in the future if they are trying to figure out something in your area of code.