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