Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    In that case, just add a dummy flush method to your writer class: def flush(self): pass Commented Oct 21, 2014 at 19:44
  • user file handler as log handler, neat. How about multiple modules access the log list/file at the same time? Commented Jan 29, 2019 at 20:43
  • @Decula I have no problem with that actually. My main programs have a redirection of sys.stdout to a pyQt5 widget that can display text, and all print(...) from modules are redirected too without having to incorporate sys.stdout = something_else. Commented Mar 12, 2020 at 14:20