NRAO Home > CASA > CASA Cookbook and User Reference Manual
1.3.7.6 Executing Python scripts

You can execute Python scripts (ASCII text files containing Python or casapy commands) using the execfile command. For example, to execute the script contained in the file myscript.py (in the current directory), you would type

  CASA <7>: execfile(’myscript.py’)

or

  CASA <8>: execfile ’myscript.py’

which will invoke the IPython auto-parenthesis feature.

NOTE: in some cases, you can use the IPython run command instead, e.g.

  CASA <9>: run myscript.py

In this case, you do not need the quotes around the filename. This is most useful for re-initializing the task parameters, e.g.

  CASA <10>: run clean.last

(see § 1.4.5.8).

See Appendix B.12 for more information.


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