Glide
The CS1010S and CS1010A team has also kindly created an online shell + editor called Glide. The address is the following.
Warning
We are not sure about the compatibility with other web browsers. We know that these are compatible with Google Chrome and Mozilla Firefox. There is also another web browser called Safe Exam Browser that will be used for practical that we know is compatible too.
Shell
The box on the right is the equivalence of IDLE shell while the currently blank box on the left is the equivalence of IDLE editor.
You may need to get used to the shell as it does not have an auto-indent feature.
To write on the shell, we need to type on the textbox at the bottom.
You can see that we are currently typing x = 2
.
If you press enter, you will see x = 2
on the shell above it.
Try it out.
Difference #1
There is a slight difference in behavior between Glide and IDLE on floating point number.
In particular, Glide will not show the number after the decimal if it is .0
.
On the other hand, IDLE will show it.
See the comparison below.
Be careful with this slight difference. Also notice that the layout may change if the size becomes smaller. This is called a responsive design.
Editor
To use the editor on Glide, we first need to create a file.
We can do this by clicking on the "Library" button.
Choose "New File" to create a new file called untitled.py
.
This file is currently Unsaved as you can see below. To change the filename, click on the filename at the top left.
To save, you can click on the "Save" or press Ctrl+S. We can also press F5 to run the code. This will automatically save the file.
Difference #2
Notice another difference. In Glide, the result of the very last expression in the file will be printed.
localStorage
Glide actually uses the localStorage
property.
So if you accidentally close your web browser, your work will still be saved on the web browser local storage.
But note that localStorage
is saving the data based on the origin.
So if you open two web browser window, only one will be saved unless you open two different web browser (e.g., open Google Chrome and open Mozilla Firefox).
We can simulate this by closing and opening the web browser again. Now we are greeted by the file we have already written before.
Simply click on "Example.py" to open your previously written file. But notice that the shell is blank.