Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yuchunzhou committed Sep 5, 2019
1 parent c275725 commit d94c638
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ Examples:
f.write("Inserted at pos 50 from end") # f.write("Inserted at pos 50 from end")
f.close() # f.close()

# Basic with/as grammer for file operation
with open("temp.txt", "w+") as f:
f.write("test")
f.seek(0, 0)
echo(f.read())

Note that due to some inherent differences between how Nim and Python handle files, a complete
1 to 1 wrapper is not possible. Notably, Nim has no equivalent to the `newlines` and `encoding`
Expand Down

0 comments on commit d94c638

Please sign in to comment.