Have you tried to open, create or delete a file through python?
So this is the recipe on how we can create and Delete a file in Python.
We have only imported os which is needed.
We have created a file by function .write and here we have created a text file. Them we have written a statement in the file and closed the file.
with open("file.txt", "xt") as f:
f.write("This is a New File. Just Created!")
We have open the file by using .read function and closed the file by .close functuion. Finally we have deleted the file by os.remove function.
with open("file.txt", "rt") as f:
data = f.read()
So the output comes as
This is a New File. Just Created!