Python User Interface Print Statements
I'm writing a CLI helper program for managing a video library. Is it better to keep any kind of print statements in a single module, passing data via return statements, 开发者_Go百科or simply print my output when I need to, where I need to?
Use return
statements properly for returning Outputs from function calls so that your I/O interfaces between functions are clear and meaningful. If you want debugging, use logging
module and when your program is development phases, you can use print statements in between too.
精彩评论