Closed Almas-Ali closed 1 month ago
It works for me...?
>>> f = File("examples/files.rn")
<core.builtin_classes.base_classes.BuiltInInstance object at ...>
>>> f.read()
"
f = File("examples/files.rn")
contents = f.read()
f.close()
print(contents)
"
>>>
Run the file not in REPL. ./radon.py -s examples/files.rn
That's because the file is already in ./examples
, when it tries to get examples/files.rn
, it actually tries to get ./examples/examples/files.rn
relative to the root of the radon
folder
So we need a separate import_cwd
for imports. That's the only reason we change directory in the first place
So import_cwd will import from the command line's cwd?
No, import_cwd would cd into the directory where the script is while leaving the process cwd unaltered
Describe the bug Could not open a file. No such file or directory!
Screenshots or Code snippets Check the
examples/files.rn
file.