This is a guess based on my knowledge of how microPython and thonny work so could be wrong.
When running from thonny, the code is pushed into RAM on the Pico which then gets erased when the Pico resets.
When running without thonny, code is read from the onboard EEPROM at start up, compiled into byte code then run. If there is a boot.py and/or a main.py in the microPython filesystem they are run (in that order) on every (re)boot. This is by design otherwise you'd not be able to run anything.
When running from thonny, the code is pushed into RAM on the Pico which then gets erased when the Pico resets.
When running without thonny, code is read from the onboard EEPROM at start up, compiled into byte code then run. If there is a boot.py and/or a main.py in the microPython filesystem they are run (in that order) on every (re)boot. This is by design otherwise you'd not be able to run anything.
Statistics: Posted by thagrol — Sun Jan 19, 2025 5:13 pm