Skip to content
← Back to Community
Can I use file IO in repl.it in python
Profile icon
ROCKINGRAYQUAZA

Can I use file IO in repl.it in python if yes then how i have tried but it is showing me an error and also tell that if I can use OS module in repl.it or not because they both are showing an error...please help.

Voters
Profile icon
KrystianDuvern1
Profile icon
ROCKINGRAYQUAZA
Comments
hotnewtop
Profile icon
CodeLongAndPros

File io:

with open("foo", 'r') as f: print(f.read()) with open("bar", 'w') as f: f.write("bar\n")

os module:

import os print(os.listdir()) os.system("ls -R /")
Profile icon
Coder100

Hello, you can certainly use file I/O. What have you tried?