The IVLE console is a programming console for python which provides features similar to the built in python command line console or IDLE GUI.

Getting Started with Console

Entering python code

Using the console is fairly straight forward. Simply enter in any valid python code into the input text box located just to the right of the >>> marks at the bottom of the screen. Once finished simply press ENTER to execute that line.

Sometimes statements may expect more than 1 line, for example after an if or for statements. This is indicated by ... to the left of the input box. Complete the command by typing in any additional lines and then press ENTER with an empty line to execute the code block.

Finally, some commands may expect input from the user (such as raw_input() function). In this case +++ will be shown next to to the input text box to indicate that the console is expecting some input from the user.

Console output

Python Console
>>> i
name 'i' is not defined
>>> i=2
>>> print i
2

All the commands you have entered as well as their output are shown in the text area above the input box. Lines beginning with a >>> are your input lines, while lines in read (such as invalid syntax (<input>, line 1) ) are errors or exceptions generated by your code.

Console history

You can also see all the lines you have previously entered into the console this session by pressing the UP arrow while in the text box. Pressing the DOWN arrow will show you more recent line histories or bring you back to your current line. You can even re-execute a line just by pressing the ENTER key.

When things go wrong...

Interrupting commands

It is possible to enter commands that will make the console become unusable or spend a long time attempting to run your command. (For example, infinite loops like while True: print "Hello, world!"). You can stop execution of a loop by clicking on the Interrupt button which will allow you to enter commands again.

Restarting the console

If things go really wrong, you can restart the console simply by clicking the Console button to start a new console. Be aware that you will loose all the variables and functions you had entered in to your previous console.