backtrader.utils.flushfile module¶
Flush File Module - Auto-flushing file wrapper for Windows.
This module provides a wrapper for file-like objects that automatically flushes after each write. On Windows platforms, it replaces sys.stdout and sys.stderr with auto-flushing versions to ensure immediate output.
- Classes:
flushfile: Wrapper that auto-flushes after each write. StdOutDevNull: Null output device that suppresses stdout.
备注
This is primarily for Windows compatibility where output buffering can cause delayed display of stdout/stderr.
- class backtrader.utils.flushfile.flushfile[源代码]¶
基类:
objectFile wrapper that auto-flushes after each write.
This class wraps a file-like object and ensures that each write operation is immediately flushed to the underlying file descriptor.
- f¶
The underlying file-like object.
备注
On Windows, this module automatically wraps sys.stdout and sys.stderr with flushfile instances.