Deleting Files #13321
Unanswered
nateProjects
asked this question in
Using MicroPython
Deleting Files
#13321
Replies: 2 comments
-
I am pretty sure that os.remove() works. I use it regularly. If you see that behaviour using Thonny, try the same without Thonny. You can as well use os.listdir() to get the „raw“ file list not processed by any IDE. |
Beta Was this translation helpful? Give feedback.
0 replies
-
import os
config = "state.json"
try:
os.remove(config)
print("Config deleted successfully")
except OSError as e:
print(e) What kind of OSError do you get? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hiya! Why doesn’t this work (it says it does)?
I’ve checked the path (/) and filename.
& I’ve tried import uos / uos.remove(config) as well as os.unlink(config) too.
What am I missing? Any ideas?
Note: This is on a Pico W / Inky Frame
Beta Was this translation helpful? Give feedback.
All reactions