Opening and Saving Files
Opening and Saving files is designed to be like to most other applications. Just use the buttons along the top of the editor window.
Clicking the Open or Save As buttons along the top will open the File Dialog. Clicking the Save + Run button will save your file and run the code. If your file hasn't been saved yet, this will also bring up the file dialog box.
The file dialog that appears is a simplified dialog that displays the current path at the top, allows you to navigate through the file tree to select the file you would like to open, and has buttons on the bottom to open or save the file you would like to use.
Canceling will tell the editor that you do not want to continue with the current operation.
The X at the top performs the same function as the Cancel button as does clicking outside of the dialog.
On the Save As dialog, you can also type in a filename in the field next to the button.
Running Code
As mentioned above, the Save + Run button will first save your file, then run the code. The logic to run the code however is currently very simplistic in that it will try a couple of basic strategies to run your code, but doesn't currently do much beyond that.
The way it works is if you are working on code.py in the root folder, a soft reset will be performed, which automatically runs code.py. If you were working on some code in another file, the editor will attempt to perform an import on this code, which should run it. When you run your code, it will automatically switch over to the serial terminal.
File Dialog Toolbar
The file Dialog toolbar along the top allows you to perform common operations on files and folders regardless of whether you are saving or opening. Clicking the cancel button at the bottom will not undo any operations that were performed with these buttons.
Renaming and Deleting Files and Folders
You can rename or delete both files and folders. An item must be selected first for the buttons to become available.
Use the delete and rename buttons here to perform the corresponding operation on the currently selected file or folder.
Creating New Folders
This feature allows you to create a new folder to store your work inside of.
Clicking the new folder button at the top will prompt you for a folder name. It will inform you of invalid folder names such as the same name as an existing file or folder or a folder that begins with a period.
Uploading and Downloading Files and Folders
This feature allows you to upload or download files as long as they fit in the available space. If you need to add images or sound files for your project, you can use the upload button to add them. If you need to retrieve a file from your device for whatever reason, the download button will give you access to do that.
You can also download folders. When you select a folder and click download, the contents of that folder are automatically zipped into a single file. If nothing is selected when you click the download button, the current folder will be used.
Moving Files and Folders
This feature allows you to move files and folders to a different location on the device. When you click the move button, another prompt will appear on top of the dialog that allows you to navigate to where you would like to move the currently selected item.
Use the move button to move files or folders to a new location on the device.
The second dialog that appears will show only folders and allow you to navigate to where you would like to move the file.
The serial terminal allows you to watch the output of your device as well as type inputs just like you can from a separate application like PuTTY, except there's nothing you need to configure. This allows you to access the REPL or view the output of your currently running code.
More Features to Come
The CircuitPython Code Editor is still under development, so expect more features to be added. If you would like to contribute on GitHub, you can submit any new issues or pull requests for review.
Text editor powered by tinymce.