Skip to content

Language feature: file I/O with open() #10

Open
@tusharsadhwani

Description

@tusharsadhwani

The current interpreter can't interact with the file system, but implementing open will solve that.

Support for reading, writing and appending to files will be needed.

file = open('foo.txt')
contents = file.read()
print(contents)
file.close()

file = open('bar.txt', 'w')
chars = file.write(contents)
print("Wrote", chars, "chars")
file.close()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions