System Notes
- Oncourse
- Always use the A201 Oncourse site with a section number beginning with C. This site combines the A201 and A257 lecture sections. The other A201 Oncourse sites are not used.
- Assignment submission: Use the Add Attachments button at the bottom of the assignment to attach files containing your work. When all attachments have been added, click the Submit button to submit your work. Nothing is submitted until you click Submit, and after you click Submit you cannot add or modify any attachments. Do not forget this when submitting programming assignments! After submitting an assignment, check that there is just a Submit button at the bottom. If the Submit and Add Attachment buttons are still there, you have not made a successful submission. Report any submission problems that you are having difficulty resolving to your lab instructor.
- After submitting an assignment you will get a confirmation email, and can view what you submitted by visiting the assignment again in Oncourse. To check an Alice program that you have submitted, you need to save it to disk first, which may require right-clicking it and selecting the "save as" or equivalent option. After saving it to disk, start Alice and open the file.
- When you save a draft of an assignment, the draft should include files attached to the assignment, but this is not reliable. Always keep a copy in your backup file space.
- You sometimes have to use the blue curved arrows to the left of a frame title to refresh the frame. For example, if you click on a folder icon in the resources frame, only the opened folder contents are displayed in the frame: to see the rest you have to click the up-arrow. You can see the contents of a folder without hiding the rest of the resources by clicking the arrow to the left of the folder symbol.
- Alice
- To start Alice on STC machines use Start > Programs > Departmentally Sponsored > CSCI > Alice.
- To print your program, use File > Export Code For Printing.... (as illustrated in the Printing section of Appendix B), visit the file this creates with a browser, and use the browser to print the file.
- Occasionally Alice corrupts the program so it is unusable (it will not run at all). If this happens, and you save the program by replacing your only copy of the program, you have just lost everything! To avoid this problem, never save an Alice program unless you have just run it without an Alice error message. If it does not run, restart Alice loading a good copy you have saved, and try to remember the changes you made since then :(
- If Alice (or similarly for any other program) becomes unresponsive or stuck pointlessly repeating the same error behavior, or wedged in geek speak, you can kill it with Start > Run > taskmgr > Applications > Alice > End Task > End Now.
- If your computer is put in standby or hibernate mode, or you change the display settings, while Alice is open, Alice is likely to be wedged when you restart the computer. It is safest to save your word and close Alice before doing anything special with your computer.
- Changing the default setting of Edit > Preferences > save and load from does not have any effect.
- Your initial scene setup may not appear when you first load your program, but it will after you play it once.
- If you plug in a flash stick or other virtual drive after starting Alice, you will not be able to see it to open a file on the new drive. Either start Alice after the drive is open or copy the files from the drive to the local disk where Alice can see them (and then don't forget to move any modified files back to the temporary drive).
- Alice world files are actually zip files. Other software systems, such as some web browsers and email readers, will recognize that an Alice world is a zip file and automatically change the extension from a2w to zip. Then you have to rename the file to restore the a2w extension before you can open it in Alice.
- You cannot start Alice by double-clicking an a2w file. This results in an error message that does not make sense.
- A null error is reported running the text CD version of Alice under XP Pro x64, though it works with the download version.
- The light range property appears to have no effect.
- There are no shadows in the Alice light rendering.
- See the text author's Troubleshooting and Debugging page.
- Python IDLE
- To start the IDLE on STC machines use Start > Programs > Development Tools > Python 2.4 > IDLE (Python GUI).
- To print your program to the default printer, use File > Print Window. To print to another printer, save the program and open it with a plain text editor such as 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.
- 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.
- 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
- Due to a quirk in the STC lab Python installation this semester, if you run a pengraphics program (or probably any program using the underlying Tk graphics library) in the IDLE it locks up the shell so only one run is possible without closing all IDLE windows. The easiest work-around for this problem is to open the directory containing your program file (and pengraphics.py) in the Windows file explorer and run your program by double-clicking its file in the file explorer. Continue using the IDLE editor. If when you double-click a program file a black window appears and then disappears almost immediately, your program had an error (probably syntactic) before the Tk system was started. In this case you can use F5 to find the error, and go back to double-clicking when you think you have fixed it. Later, when your programs are not doing Tk-based graphics, you can also run them in the IDLE using F5.
- The shell prints nothing if an expression is entered that returns None.
- Edit > Go to Line (Alt-G) is useful in finding the line that an error message identifies. Look for the cursor at the beginning of a line after using this editor command.
- 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.
- Text is not colorized until it is saved in a file with the .py extension.
- Known bugs:
- If pressing F5 does nothing, close the IDLE and restart it.
- If an uninitialized variable is encoutered in debug mode, the program may terminate without an error message.
- Python language
- 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.
- 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.
- 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 using the reload function).
- On Windows machines if a Python program is invoked in the OS command shell by just its file name, there is a bug that breaks input redirection. Fortunately things do work when the command is python programFile, followed optionally by program arguments and I/O redirection.
More system notes will appear in
this space as additional anomalies are discovered.