This recipe will show you how to read the contents of a file into variables in your scripts. This recipe will cover ways of reading in file contents as a string, as well as reading it in as a byte object. Many projects that you create will often need to open different data files, such as audio files, images, and text files. This recipe will provide you with the basic building blocks so that you can facilitate these interactions.
Reading a file's contents
Getting ready
You will need access to the REPL on Circuit Playground Express to run the code presented in this recipe.