Incremental file name system
Posted: Wed Apr 13, 2022 3:38 pm
Sorry if this is a really simple question, I am very much a beginner at this. I am a mechanical engineer and I am trying to use a Pi Pico as a simple(& cheap) data logger.
I want to create an incremental file name system.
Stack overflow lead me to this https://stackoverflow.com/questions/179 ... -in-python
And this simple script:
import os
i = 0
while os.path.exists("sample%s.xml" % i):
i += 1
fh = open("sample%s.xml" % i, "w")
The os library on the Pi Pico doesn’t appear to contain the same set as a full python library and therefore I just get errors.
Could somebody please tell me how I can load these commands to the Pico or is there a better solution somebody could suggest?
I want to create an incremental file name system.
Stack overflow lead me to this https://stackoverflow.com/questions/179 ... -in-python
And this simple script:
import os
i = 0
while os.path.exists("sample%s.xml" % i):
i += 1
fh = open("sample%s.xml" % i, "w")
The os library on the Pi Pico doesn’t appear to contain the same set as a full python library and therefore I just get errors.
Could somebody please tell me how I can load these commands to the Pico or is there a better solution somebody could suggest?