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

1099.1.100 by Nick Chadwick
Created a new help system.
1
<div class="helpfile">
927 by wagrant
browser, console: Rewrite and extend the Help pages. How does Matt
2
<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>
3
4
<h2>Getting started</h2>
5
<h3>Entering Python code</h3>
6
<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>
7
1666 by William Grant
Redo console CSS, and replace the examples on the help page with something more like the modern console that also doesn't break the real console with ID conflicts.
8
<div class="console_help_example">
9
  <div class="console_heading">
10
    Python Console (example)
11
  </div>
12
  <div class="console_help_example_body">
13
    <div class="console_input" style="padding-top: 0.5em">
14
      <div>
15
        <div>
16
          <label class="console_prompt">&gt;&gt;&gt; </label>
17
        </div>
18
        <div class="console_inputCell">
19
          <input type="text" value="print 'Hello, world!'" class="console_inputText" disabled="disabled" />
20
        </div>
21
        <div>
22
          <input type="button" value="Interrupt" disabled="disabled" />
23
          <input type="button" value="Clear Output" disabled="disabled" />
24
          <input type="button" value="Reset" disabled="disabled" />
25
        </div>
26
      </div>
27
    </div>
28
  </div>
731 by dcoles
Help: Wrote a small help document for the console app. Now one less glaring
29
</div>
927 by wagrant
browser, console: Rewrite and extend the Help pages. How does Matt
30
1668 by William Grant
Tweak console docs a bit.
31
<p>Sometimes Python may expect additional lines of input &mdash; 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>
927 by wagrant
browser, console: Rewrite and extend the Help pages. How does Matt
32
33
<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>
34
1668 by William Grant
Tweak console docs a bit.
35
<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>. There is also a limit on the amount of CPU power a single console can use. This limit is in place to prevent accidental monopolisation of resources; if you exceed it, just <a href="#restarting">restart the console session</a>.</p>
927 by wagrant
browser, console: Rewrite and extend the Help pages. How does Matt
36
37
<h3>Interpreting output</h3>
1666 by William Grant
Redo console CSS, and replace the examples on the help page with something more like the modern console that also doesn't break the real console with ID conflicts.
38
<div class="console_help_example">
39
  <div class="console_heading">
40
    Python Console (example)
41
  </div>
42
  <div class="console_help_example_body">
1667 by William Grant
Make the console example a bit more plausible (ie. use a real session transcript).
43
    <pre class="console_output outputMsg">
44
<span class="inputPrompt">&gt;&gt;&gt; </span> <span class="inputMsg">i</span>
45
<span class="errorMsg">Traceback (most recent call last):
46
File "&lt;web session&gt;", line 1, in &lt;module&gt;
47
NameError: name 'i' is not defined</span>
48
<span class="inputPrompt">&gt;&gt;&gt; </span><span class="inputMsg">i = 2</span>
49
<span class="inputPrompt">&gt;&gt;&gt; </span><span class="inputMsg">if i == 2:</span>
50
<span class="inputPrompt">... </span><span class="inputMsg">    print i</span>
51
<span class="inputPrompt">... </span><span class="inputMsg"></span>
52
2</pre>
1666 by William Grant
Redo console CSS, and replace the examples on the help page with something more like the modern console that also doesn't break the real console with ID conflicts.
53
    <div class="console_input">
54
      <div>
55
        <div>
56
          <label class="console_prompt">&gt;&gt;&gt; </label>
57
        </div>
58
        <div class="console_inputCell">
59
          <input type="text" class="console_inputText" disabled="disabled" />
60
        </div>
61
        <div>
62
          <input type="button" value="Interrupt" disabled="disabled" />
63
          <input type="button" value="Clear Output" disabled="disabled" />
64
          <input type="button" value="Reset" disabled="disabled" />
65
        </div>
66
      </div>
67
    </div>
68
  </div>
731 by dcoles
Help: Wrote a small help document for the console app. Now one less glaring
69
</div>
70
1668 by William Grant
Tweak console docs a bit.
71
<p>Each line that you have entered &mdash; as well as any output produced &mdash; 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>
927 by wagrant
browser, console: Rewrite and extend the Help pages. How does Matt
72
73
<h3>Reviewing history</h3>
74
<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>
731 by dcoles
Help: Wrote a small help document for the console app. Now one less glaring
75
76
<h2>When things go wrong...</h2>
77
<h3>Interrupting commands</h3>
927 by wagrant
browser, console: Rewrite and extend the Help pages. How does Matt
78
<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>
79
80
<h3><a name="restarting">Restarting the console</a></h3>
1668 by William Grant
Tweak console docs a bit.
81
<p>If things go really wrong, you can restart the console simply by clicking the <em>Reset</em> button. Be aware that you will lose all state (such as variables and functions) entered into your previous console session.</p>
1099.1.100 by Nick Chadwick
Created a new help system.
82
</div>