NRAO Home > CASA > CASA Cookbook and User Reference Manual

B.3 Indentation

Python pays attention to indentation of lines in scripts or when you enter them interactively. It uses indentation to determine the level of nesting in loops. Be careful when cutting and pasting, if you get the wrong indentation, then unpredictable things can happen (usually it just gives an error).

A blank line can be used to return the indentation to a previous level. For example, expanded parameters in tasks cause indentation in subsequent lines in the interface. For example, the following snippet of inputs from clean can be cut and pasted without error due to the blank line after the indented parameters:

mode                =  ’channel’        #   Type of selection  
     nchan          =         -1        #   Number of channels to select  
     start          =          0        #   Start channel  
     step           =          1        #   Increment between channels/velocity  
     width          =          1        #   Channel width  
 
alg                 =    ’clark’        #   Algorithm to use

If the blank line were not there, an error would result if you pasted this at the casapy prompt.


More information about CASA may be found at the CASA web page

Copyright © 2010 Associated Universities Inc., Washington, D.C.

This code is available under the terms of the GNU General Public Lincense


Home | Contact Us | Directories | Site Map | Help | Privacy Policy | Search