Skip to content

Latest commit

 

History

History
8 lines (6 loc) · 172 Bytes

python.md

File metadata and controls

8 lines (6 loc) · 172 Bytes

Python

Open and read a file contents

with open(Path.home() / "file.example", "r", encoding="utf-8") as file:
    first_line = file.read().splitlines()[0]