not logged in | [Login]

(Construction) Examples on how to use the SD card.

Conflict about SD card access when connected to host machine. It is mounted as a Drive, but if it is mounted as a drive then it's not available for the embedded CPU to use.

Note: Once you've opened a file, you can readlines() as usual but there is an issue with lists. .readlines() can be written as the equivalent list(f) if you really need the list of lines.

E.g. Compare these approaches:

fileobj = f.open()
for line in fileobj:
    print line
fileobj = f.open()
for line in fileobj.readlines():
    print line
fileobj = f.open()
lines = list(fileobj.readlines())
for line in lines:
    print line