import machine, uos # machine.SDCard(slot=1, width=1, cd=None, wp=None, sck=None, miso=None, mosi=None, cs=None) sd = machine.SDCard() uos.mount(sd, '/sd') def cat(file, encoding='utf8'): """Prints the file.""" with open(file, mode='r', encoding=encoding) as f: for line in f.readlines(): print(line) def to_file(file, text='', encoding='utf8'): """Simple function to write some text to a file.""" with open(file, mode='r', encoding=encoding) as f: f.write(text)