Thursday, February 11, 2010

Running Scientific Notebook Outside the Lab




You should be able to run Scientific Notebook from most
computers on the AU network. Proceed as follows.





  1. Logon to AU network using Novell client


  2. Run Windows Explorer


  3. Select the folder U:\SciNotebook5 and double click on U:\SciNotebook5\scinoteb.exe

Common Python Questions





Where can I get Python?


You can download Python from the official website. Alternatively, you may wish to consider the Enthought Python Distribution.


What version should I download?


Anything above 2.5.1 should be fine.


How can I get started?


It is important to realize that Python has excellent online documentation. Begin with sections 3, 4, and 5 of the Python tutorial. Do not just read the tutorial: work through it using the interactive Python interpreter. Your constant companion should be the Python Library Reference. If you have no programming experience at all, perhaps the First Steps tutotial will be useful. Be sure to be careful about operator precedence.


How do I get colorized Python code when I am programming?


Use an editor that supports syntax highlighting. I like Vim


How do I copy a set?


Look at the documentation for the set types. There you find that sets have a ``copy`` method, so if ``s`` is a set you can produce a copy as ``s.copy()``. You also find that sets have an ``add`` method, so if ``s`` is a set and ``x`` is an element you wish to add, you can do so as ``s.add(x)``.


What is a boolean type?


Python has a special Boolean type, represented by the constants ``False`` and ``True``. They are special constants, like 0 and 1. These are not strings! A string is only false if empty. Compare:

>>> bool('')
False
>>> bool('False')
True
>>> bool(False)
False



How do I create a NumPy matrix?


After you install Python, you need to download and install NumPy. (Unless you use a distribution that includes NumPy.) Once it is installed, you can instantiate the matrix class in one of the following ways:

#best way (but least convenient)
import numpy
x = numpy.mat('1 2; 3 4')

#2nd best: import just the command you want
from numpy import mat
x = mat('1 2; 3 4')

#most common and least safe: import all numpy commands
from numpy import *
x = mat('1 2; 3 4')

That final way is used in the Numpy tutorial and in the
NumPy examples. You will also want to look at the NumPy Book.