This method works for most multi-file programs, including HTML, Java, and Python projects.
Click the to the far right of the program name. Select Delete from the menu. 3. Important Restrictions & Tips
If the file does not exist or cannot be deleted for some reason, the removeFile() function will throw an error. You can use a try - catch block to handle this error: how to delete a file in codehs
var filename = "example.txt";
| Method | Works? | Notes | |--------|--------|-------| | Right-click → Delete in editor | ✅ Yes (most cases) | Easiest way | | os.remove() in Python | ⚠️ Maybe | Often blocked | | File.delete() in Java | ⚠️ Maybe | Often blocked | | fs.unlinkSync() in JS | ⚠️ Maybe | Often blocked | This method works for most multi-file programs, including
: A confirmation dialog will appear; click OK to finish. 2. Managing Programs in the Sandbox
import os
In this example, the file example.txt will be deleted from the file system.
: Click the down arrow (or three dots "...") next to the file name. turn off the "Show Blocks" setting
: You can also remove entire folders by clicking the same down arrow or three dots menu next to the folder name. For Students: Creating and Managing Multi-File Programs
: You cannot delete files while in "Block" view. You must go to your Block Setting Preferences , turn off the "Show Blocks" setting, and refresh your page to see the delete options.