public FileReader(notnull filePath as Path, encoding as String = "utf-8")
Creates a reader on the given file path.
| Parameter | Description |
|---|---|
filePath | File path to read from. |
encoding | Charset name; auto detects a Unicode BOM, otherwise UTF-8. |
try reader = FileReader(Path("notes.txt"), encoding="utf-8"):
print(reader.read())