Skip to content
Can I use file IO in in python
Profile icon

Can I use file IO in 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 or not because they both are showing an error...please help.

You are viewing a single comment. View All
Profile icon

File io:

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

os module:

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