Download 5.2 User Guide Addendum - 2KB

Transcript
Python API
An Introduction to Python in AMS REALTIME
Python is an easy to learn, powerful programming language that is interpretive and
interactive in an object-oriented framework. It is often compared to Tcl, Perl,
Scheme or Java. Python scripts can interact with many programs and operating
systems. It has efficient high-level data structures and a simple, but effective,
approach to object-oriented programming. Python's elegant syntax and dynamic
typing, together with its interpretive nature, make it an ideal language for scripting
and rapid application development in many areas.
The Python interpreter and the extensive standard library are freely available in
source or binary form for all major platforms from the Python web site,
http://www.python.org, and it can be freely distributed. The same site also contains
distributions of (and pointers to) many free or inexpensive third party Python
modules, programs and tools, and additional documentation.
The Python interpreter is easily extended with new functions and data types
implemented in C or C++ (or other languages callable from C). Python is also
suitable as an extension language for customizable applications. Python syntax is
similar to C, with modules, classes, exceptions, very high level dynamic data types,
and dynamic typing.
For a description of standard objects and modules, see the Python Library Reference
document. The Python Reference Manual gives a more formal definition of the
language. To write extensions in C or C++, read the Extending and Embedding and
Python/C API manuals. There are also several books covering Python in depth. For
a basic start in Python, try Learning Python, written by Mark Lutz and David Ascher,
published by O'Reilly and associates. There are also tutorials that can be found on
the web.
All AMS REALTIME products embed the Python language engine, and they export
modules that are usable from the embedded Python engine. This allows end-users
with programming ability to customize their off-the-shelf software by programming
Python scripts to help manage repetitive processes, or automate event drive
processes, such as business rule validation and automatic email messaging. Just like
AMS REALTIME, Python runs on Windows, Macintosh and Unix platforms.
A key advantage to customizing AMS REALTIME with Python is that when the
software is upgraded to a new version, user-defined scripts will not be overwritten,
and will still function with the new software.
104 • Python API
AMS REALTIME 5.2 Addendum