Table of Contents > Getting Started with JES > Working with Files

Working with Files

Working with files in JES is a lot like working with files in a word processor.


File Types

Since your programs will be written in Jython, and Jython is just a Java version of the language Python, your program files should be saved with the Python extension .py, as in:

 MyFile1.py

JES will allow you to open any file that is written as plain text. That means that if you wanted to, you could use standard text editors such as NotePad on Windows, or TextEdit on Mac to write programs and then open them in JES later on. You should never use word processors like Word to edit programs. Word adds lots of extra information to your files, which can cause your program not to run when you test it out in JES.

jump to top
Creating New Files

To create a new file in JES, select "New" from the file menu (or press Ctrl-n).

In JES, only one file may be open at any time. That means that if you create a new file, JES simply replaces any file that was already open with a new, blank, unnamed file. Be aware that JES will not ask you if you would like to save changes in the open file, it will simply abandon that file and, if you have not saved it, your changes will be lost.

jump to top
Opening Files

To open a file, simply select "Open" from the file menu (or press Ctrl-o); a file selection dialog box will appear.

You may not open more than one file at one time. When you open a file, JES simply replaces any file that was already open with the new file. Be aware that JES will not ask you to save changes in the open file, it will simply abandon that file and, if you have not saved it, your changes will be lost.

jump to top
Saving Files

Save files in JES by selecting "Save" from the file menu (or press Ctrl-s).

Of course, the first time you save a file you will be prompted for a unique name for that file. As in most word processors you have used, JES allows you to save a file with a new name by selecting "Save As" from the File menu (or press Ctrl-Shift-s).

Save early and save often!

jump to top
Printing Files

Print files in JES by selecting "Print" from the file menu (or press Ctrl-p).

jump to top
Loading Files

To load a file, click on the "Load" button between the program and command areas of JES.

Loading files is something you may not have encountered before. When you load a file, it causes the program that you wrote in the program area to become available in the command area. Once it is loaded, you can use the command area to call your program and test it out. Remember that your file must be saved before you load it. If you try to load it without saving first, it will not load any changes that you might have made since the last load.

jump to top