|
VEX V5 Python API
|
Public Member Functions | |
| def | __init__ (self, parent) |
| Use the SD Card class to load or save files on your SD card. More... | |
| def | is_inserted (self) |
| Gets whether an SD card is inserted into the slot. More... | |
| def | filesize (self, filename) |
| Gets the size of a file on the SD card, -1 on error (e.g. More... | |
| def | loadfile (self, filename, buffer) |
| Loads a file from the SD card. More... | |
| def | load_to_bytearray (self, filename, size=None) |
| Loads a file from the SD card into a new bytearray. More... | |
| def | load_to_string (self, filename, size=None) |
| Loads a file from the SD card into a string. More... | |
| def | savefile (self, filename, buffer) |
| Saves a file to the SD card. More... | |
| def | appendfile (self, filename, buffer) |
| Appends data to an existing file. More... | |
| def vex.BrainSDCard.__init__ | ( | self, | |
| parent | |||
| ) |
Use the SD Card class to load or save files on your SD card.
| def vex.BrainSDCard.is_inserted | ( | self | ) |
Gets whether an SD card is inserted into the slot.
| def vex.BrainSDCard.filesize | ( | self, | |
| filename | |||
| ) |
Gets the size of a file on the SD card, -1 on error (e.g.
file does not exist)
| filename | the name of the file, use either '/' or '\' for directory separator. |
| an | exception load failed (e.g. the file does not exist) |
| def vex.BrainSDCard.loadfile | ( | self, | |
| filename, | |||
| buffer | |||
| ) |
Loads a file from the SD card.
| filename | the name of the file, use either '/' or '\' for directory separator. |
| buffer | pre-allocated bytearray of a fixed length that will be filled with file data. |
| def vex.BrainSDCard.load_to_bytearray | ( | self, | |
| filename, | |||
size = None |
|||
| ) |
Loads a file from the SD card into a new bytearray.
| filename | the name of the file, use either '/' or '\' for directory separator. |
| size | (optional) number of bytes to read. If omitted, will be equal to the file size. |
| def vex.BrainSDCard.load_to_string | ( | self, | |
| filename, | |||
size = None |
|||
| ) |
Loads a file from the SD card into a string.
| filename | the name of the file, use either '/' or '\' for directory separator. |
| size | (optional) number of bytes to read. If omitted, will be equal to the file size. |
| def vex.BrainSDCard.savefile | ( | self, | |
| filename, | |||
| buffer | |||
| ) |
Saves a file to the SD card.
| filename | the name of the file, use either '/' or '\' for directory separator. |
| buffer | data to save, either a string or a byterray object |
| an | exception if save failed (e.g. insufficient space) |
| def vex.BrainSDCard.appendfile | ( | self, | |
| filename, | |||
| buffer | |||
| ) |
Appends data to an existing file.
| filename | the name of the file, use either '/' or '\' for directory separator. |
| buffer | data to append, either a string or a byterray object |
| an | exception if save failed (e.g. insufficient space) |
1.8.15