Using micro python I am trying to redirect stderr to a file however I dont have access to the run command on the board so I cannot do any shell redirect commands like >> > |
. I'm curious if there is a way to do this in Micropython.
I've tried
import sys
sys.stdout = open('out.txt', 'w')
sys.stderr = sys.stdout
however
https://forum.micropython.org/viewtopic.php?t=2091 <- this discussion mentions that it is not a method supported. Im curious if y'all have any ideas. Most my googling leads itself to just python instead of micropython.
but get an error stating module has no attribute named stdout thanks
I have not tried it, but the doc suggests you can do this if you use
usys
rather thansys
. Theopen()
will actually call uio.open().