OS Error: 2 while opening a file #1745
-
I want to open a file (self.file = open(filename, "rb")) on my pybricks Spike Prime robot, but i am getting an OSError: 2 and the errorcodes ({1: 'EPERM', 5: 'EIO', 16: 'EBUSY', 19: 'ENODEV', 22: 'EINVAL', 95: 'EOPNOTSUPP', 11: 'EAGAIN', 116: 'ETIMEDOUT', 140: 'ECANCELED'}) doesnt include this error. So I am wondering what this error means since I didnt find anything. (I am using pybricksdev to upload files in VS Code) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
Pybricks for SPIKE Prime doesn't have a file system currently, so it isn't possible to create a file. If you want to save a small amount of data, like a calibration value, you can use Or if you want log data, you can use the |
Beta Was this translation helpful? Give feedback.
Yes, there is a
gc
module.There is also a
gc.threshold(()
function that can be useful instead of manually callinggc.collect()
.https://docs.micropython.org/en/latest/library/gc.html