A202 / I211 System notes

  1. Printing
    1. Printing pages on this web: This web uses HTML frames so the contents stay visible on the left. To print the contents of the right frame, you may have to select the frame by highlighting some text in the frame, and then issue the print command.
    2. Printing files on STC machines: If you have a plain text file you want to print on an STC machine, use  the Python IDLE or Start > Programs > Utilities > Accessories > Notepad. You have to open the file or paste what you want to print. Notepad uses by default a large font that gives you about 70 characters per line, but you can use Format > Font to select a smaller font. Do not use the DOS print command, which causes the command prompt window process to hang, or word processors such as Word or Write, for they do not by default use a mono spaced (fixed character width) font, and may do other strange things that mess up indentation or worse.
  2. IDLE
    1. Typing is silently ignored if the cursor is not after the last '>>> ' prompt (and the space is part of the prompt). Pressing enter when not on the last line copies the current line to the end. Ctrl-C moves to the end with a KeyboardInterrupt exception, without copying text.
    2. Ctrl-C in the shell window can usually be used to terminate a program. Sometimes a couple of ctrl-Cs in rapid succession are required. This is useful if it is in an infinite loop or stopped waiting for input. If Ctrl-C doesn't work, Ctrl-F6, the Shell > Restart Shell command, will always do the job
    3. The shell prints nothing if an expression is entered that returns None.
    4. The Help > Python Docs (F1) command pops up a Python documentation window. This is the same html documentation that is linked from the course web contents panel, with the addition of a navigation tab panel. The index tab is usually the fastest way to find something if you know what it's called or where it is located. Sometimes the search tab is also helpful, and the contents tab is good for browsing.
    5. Known bugs:
      1. Pop-up argument help does not always go away when it should.
      2. Find/replace does not always highlight the next string found.
  3. Python
    1. Since Python uses indentation to determine program structure, indentation is critical! Never use an editor that may insert tabs in your program. If there are tabs in your program, and particularly if tabs and spaces are combined in the indentation of a line, Python's idea of how much the line is indented may not correspond to what you see in an editor, so your program may be interpreted in a very different way than you expect. If you suspect that tabs may be in your file, in the Python editor use the Edit > Select All and then Format > Untabify Region commands.
    2. If you fail to close a left parenthesis or left bracket on a line, you will probably get an error message complaining about the syntax of the following line.
    3. If you import a module in the shell and then modify it, you may be temped to import it again, but the second import will have no effect! Never re-import a module without first restarting the shell (or use the reload function instead).
More system notes will appear in this space as additional anomalies are discovered.