Editing Code Two Ways
Step 3Editing code on the website
There are two ways to edit the code on the device. The first is using the website editor: edit the code below on line 4 to say print("Hello from the website editor!") and click Run on Device to see the change. The website isn't required to write code, though. You can edit it fully on your computer and fully offline.
Editing code offline
To edit code offline:
- Click Disconnect to make sure you are disconnected from the web page.
- Find the
CIRCUITPYdrive on your computer, open it, and edit thecode.pyfile inside. You can use many text editors like Notepad or VS Code. - Save the file. The new code starts running on the board as soon as you do.
To check that it worked, edit the text to say "Hello from the local editor!", save it, then come back to the webpage and press Connect again. You should see the new text printing in the console. In a future step we will see how you can also have an offline console.