micropython_read_lines
Read a specific range of lines from a text file on a MicroPython board, enabling partial file inspection without loading the entire file.
Instructions
MicroPython ボード上のテキストファイルを行単位で一部読み出す。
Args: path: 対象ファイルパス start_line: 1 始まりの開始行番号 max_lines: 返却する最大行数 timeout: コード送信から Raw REPL 復帰完了までの全体タイムアウト秒数 encoding: テキストデコードに使うエンコーディング errors: テキストデコード時のエラー処理
Returns: ok: 読み出しに成功したら True path: 対象ファイルパス start_line: 実際に使った開始行番号 line_count: 返した行数 content: 返したテキスト eof: 返却範囲がファイル末尾に達したら True error: エラー時のメッセージ
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| errors | No | strict | |
| timeout | No | ||
| encoding | No | utf-8 | |
| max_lines | No | ||
| start_line | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| eof | Yes | ||
| path | Yes | ||
| error | Yes | ||
| content | Yes | ||
| line_count | Yes | ||
| start_line | Yes |