I'm starting to use Raspberry Pi Picos more and I think Thonny is holding me back. I want to mount it as a device on my Mac so I can use terminal commands, or finder if possible, to navigate through it. I've tried accessing the REPL, and can do so, but that is only a MicroPython shell, so it's not useful for this. Does the MicroPython shell have a function for files?
You can't.
If you have a Pico W model ("W" = with WiFi), you can develop a web server which allows you to upload and download files.
MicroPython reserves some flash space for an internal filesystem, which can only be accessed from within MicroPython.
In the REPL, try:
import os
os.listdir()
This will give you a directory listing of the internal filesystem.
Check out the documentation: https://pico.nxez.com/docs/micropython/en-us/esp8266/tutorial/filesystem.html
Yes, that's for the ESP8266, but it'll work work with the Raspberry Pi Pico models as well. It's, let's say, a bit confusing that the documentation for the RP20xx platforms is a bit lacking here.
I don't know how Thonny works with the filesystem, but I guess it's something like that:
import binascii
b64_data = 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPg0KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik04IDEwTDggMTRMNiAxNEwtMi42MjI2OGUtMDcgOEw2IDJMOCAyTDggNkwxNiA2TDE2IDEwTDggMTBaIiBmaWxsPSIjMDAwMDAwIi8+DQo8L3N2Zz4='
with open('left-arrow.svg', 'w') as fp:
fp.write(binascii.a2b_base64(b64_data)))
This will store a file on the internal MicroPython filesystem. The data is encoded in Base 64 (so it's safe to be used in the REPL) and binascii.a2b_base64() turns it back into the original binary data.
The internal filesystem of MicroPython is, in some sense, the equivalent of EEPROM storage (persistent storage) for the RP20xx Pico platform.
The example uses an image created by Noah Jacobus, under PD License, downloaded from https://www.svgrepo.com/svg/535155/arrow-left