~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/apps/console/help.html

  • Committer: dcoles
  • Date: 2008-07-03 04:38:30 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:804
Setup: To go with last revision - Now just a front end for the setup package

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<p>The IVLE <strong>Console</strong> is a programming console for Python which provides features similar to the Python command line console or <a href="http://en.wikipedia.org/wiki/IDLE_(Python)">IDLE</a> GUI.</p>
2
 
 
3
 
<h2>Getting started</h2>
4
 
<h3>Entering Python code</h3>
5
 
<p>Using the console is fairly straightforward. Enter any valid Python code into the input text box located just to the right of the prompt (<code>&gt;&gt;&gt;</code>) at the bottom of the screen. When the line is complete, press ENTER to execute the code.</p>
6
 
 
 
1
<p>The IVLE <strong>console</strong> is a programming console for python which 
 
2
provides features similar to the built in python command line console or <a 
 
3
href="http://en.wikipedia.org/wiki/IDLE_(Python)">IDLE GUI</a>.<p>
 
4
 
 
5
<h2>Getting Started with Console</h2>
 
6
<h3>Entering python code</h3>
 
7
<p>Using the console is fairly straight forward. Simply enter in any valid 
 
8
python code into the input text box located just to the right of the 
 
9
<code>&gt;&gt;&gt;</code> marks at the bottom of the screen. Once finished 
 
10
simply press ENTER to execute that line.</p>
7
11
<div class="example" style="border: solid 1px black; padding: 0.5em">
8
12
    <label id="console_prompt">&gt;&gt;&gt;&nbsp;</label>
9
13
    <input id="console_inputText"
10
 
     type="text" size="80" value="print 'Hello, world!'" readonly="readonly" />
11
 
    <input type='button' value='Interrupt' disabled="disabled" />
12
 
    <input type='button' value='Clear Output' disabled="disabled" />
 
14
      type="text" size="80" value="print 'Hello, world!'" readonly />
 
15
    <input type='button' value='Interrupt' disabled />
 
16
    <input type='button' value='Clear Output' disabled />
13
17
</div>
14
 
 
15
 
<p>Sometimes Python may expect additional lines of input - for example, after the <code>if</code> or <code>for</code> statements. This condition is indicated by a <code>...</code> prompt next to the input. Complete the command by entering additional lines as required. Press ENTER with an empty line to mark the code block as complete and execute it.</p>
16
 
 
17
 
<p>Finally, some commands (such as <code>raw_input()</code>) may expect further input from the user. In this case the prompt will be replaced with <code>+++</code> to indicate that input other than Python code is required.</p>
18
 
 
19
 
<p>Please note that the console will time out after a period of inactivity. This has a similar result (and thus similar ramifications) to <a href="#restarting">restarting the console manually</a>.</p>
20
 
 
21
 
<h3>Interpreting output</h3>
 
18
<p>Sometimes statements may expect more than 1 line, for example after an 
 
19
<code>if</code> or <code>for</code> statements. This is indicated by 
 
20
<code>...</code> to the left of the input box. Complete the command by typing 
 
21
in any additional lines and then press ENTER with an empty line to execute the 
 
22
code block.</p>
 
23
<p>Finally, some commands may expect input from the user (such as 
 
24
<code>raw_input() function</code>). In this case <code>+++</code> will be shown 
 
25
next to to the input text box to indicate that the console is expecting some 
 
26
input from the user.</p>
 
27
<h3>Console output</h3>
22
28
<div class="example">
23
29
    <div id="console_body">
24
30
        <div style="background-color: gray; border: 2px solid black; padding:       
35
41
        <span style="color:#800">&gt;&gt;&gt; </span>
36
42
        <span style="color:gray">print i</span><br/>
37
43
        2
38
 
        </code>
 
44
        <code>
39
45
    </div>
40
46
    <div id="console_inputArea">
41
 
        <label id="console_prompt_2">&gt;&gt;&gt;&nbsp;</label>
42
 
        <input id="console_inputText_2" type="text" size="80" value="print i+2" 
43
 
        readonly="readonly" />
44
 
        <input type='button' value='Interrupt' disabled="disabled" />
45
 
        <input type='button' value='Clear Output' disabled="disabled" />
 
47
        <label id="console_prompt">&gt;&gt;&gt;&nbsp;</label>
 
48
        <input id="console_inputText" type="text" size="80" value="print i+2" 
 
49
        readonly />
 
50
        <input type='button' value='Interrupt' disabled />
 
51
        <input type='button' value='Clear Output' disabled />
46
52
    </div>
47
53
</div>
48
54
 
49
 
<p>Each line that you have entered - as well as any output produced - is shown in the text area above the input. Lines beginning with a normal prompt (<code style="color: #800">&gt;&gt;&gt;</code>) are your input lines, while lines in red (such as <code style="color: red">invalid syntax (&lt;input&gt;, line 1)</code>) are generated errors or exceptions. Other lines are normal output from your code.</p>
50
 
 
51
 
<h3>Reviewing history</h3>
52
 
<p>The IVLE console maintains a log of all entered commands in order to allow simple repetition of history. The up and down arrow keys will scroll backwards and forwards through the input history. As with any other line of code, pressing ENTER will execute the line currently in the input.</p>
 
55
<p>All the commands you have entered as well as their output are shown in the 
 
56
text area above the input box. Lines beginning with a <code style="color: 
 
57
#800">&gt;&gt;&gt;</code> are your input lines, while lines in read (such as 
 
58
<code style="color: red">invalid syntax (&lt;input&gt;, line 1)
 
59
</code>) are errors or exceptions generated by your code.</p>
 
60
<h3>Console history</h3>
 
61
<p>You can also see all the lines you have previously entered into the console 
 
62
this session by pressing the UP arrow while in the text box. Pressing the DOWN 
 
63
arrow will show you more recent line histories or bring you back to your 
 
64
current line. You can even re-execute a line just by pressing the ENTER 
 
65
key.</p>
53
66
 
54
67
<h2>When things go wrong...</h2>
55
68
<h3>Interrupting commands</h3>
56
 
<p>It is possible to enter commands that will render the console unusable or take a long time to complete (infinite loops like <code>while True: print "Hello, world!"</code>, for example). You may terminate execution of the current command with the <em>Interrupt</em> button. This should allow you to resume entering of commands.</p>
57
 
 
58
 
<h3><a name="restarting">Restarting the console</a></h3>
59
 
<p>If things go really wrong, you can restart the console simply by clicking the <em>Console</em> tab. Be aware that you will lose all state (such as variables and functions) entered into your previous console session.</p>
 
69
<p>It is possible to enter commands that will make the console become unusable 
 
70
or spend a long time attempting to run your command. (For example, infinite 
 
71
loops like <code>while True: print "Hello, world!"</code>). You can stop 
 
72
execution of a loop by clicking on the <emph>Interrupt</emph> button which will 
 
73
allow you to enter commands again.</p>
 
74
<h3>Restarting the console</h3>
 
75
<p>If things go really wrong, you can restart the console simply by clicking 
 
76
the <emph>Console</emph> button to start a new console. Be aware that you will 
 
77
loose all the variables and functions you had entered in to your previous 
 
78
console.</p>