import os
file = open("test.txt", "w") file.write("test") file.close()
os.listdir()
os.remove("test.txt")
os.listdir()
import os file = open("test.txt", "w") file.write("test") file.close() os.listdir() os.remove("test.txt") os.listdir()
Testing the code
https://techtutorialsx.com/2019/02/12/microbit-micropython-deleting-a-file-from-the-file-system/