Skip to main content
Enabling File I/O

Learn how to enable file I/O in the Code Editor

Gareth Gebhardt avatar
Written by Gareth Gebhardt
Updated over 2 months ago
This is a free feature

Users can control whether file I/O (input and output) is synced from the server to the browser on compatible items within the CodeHS Code Editor.

Teachers will be able to change file I/O settings on any assignment or program for which they have Edit permissions. Students will be able to change these settings only on compatible programs they've created within their own Sandbox. By default, this feature is set to "on" for Sandbox programs.

Note: If you are adjusting this setting for an assignment you've created as a teacher, you'll need to first open the assignment in the Code Editor. You can do this from your Create page by clicking the (. . .) and selecting View, or from your assignments page by clicking the blue eye icon:

Screenshot demonstrating how to view a program in the Code Editor from the Create page
Screenshot demonstrating how to preview an assignment in the Code Editor from the Assignments page

Adjusting File I/O Settings

To adjust file I/O settings in your program:

  1. Open the program in the Code Editor.

  2. Click the gear icon (⛭).

  3. Scroll down to Other.

  4. Toggle Enable File I/O to on.

  5. Refresh the page to see the changes take effect.

Screenshot demonstrating how to adjust the File I/O setting in the Code Editor

Demonstration of how to adjust file I/O settings for custom assignments:

Limitations and Compatibility

This feature is only available for program types that run on the servers, such as Python (but not Brython), Java, and C++. Programs such as JavaScript or Brython run in the browser and do not have this feature enabled.

Full Compatibility List

Compatible Program Types

Incompatible Program Types

All Java program types

All JavaScript program types except Node

JavaScript Node

Python 3 (turtle); Python 3 Graphics (Brython); Python Karel, Super Karel, and Ultra Karel;

Python 3, Python 3 (tkinter), Pygame, Python 3 Data Science, Python 3 Data Science (Graphics)

All HTML program types, including WebDev, Firebase, and Virtual Reality with A-Frame

C

SQL

Swift

Bit Interpreter

Scheme

Scratch and Scratch Jr.


Still have questions? Contact our team at hello@codehs.com to learn more!

Did this answer your question?