Benefits: The version of Python distributed with ABAQUS Version 6.6 provides increased functionality, performance, and reliability compared with the version of Python distributed with ABAQUS Version 6.5.
Description: The version of Python that is distributed with ABAQUS has been upgraded to 2.3.3 from 2.0. Full details of the changes in each intermediate release of Python can be found at the download section of the Python home page.
The following list summarizes the significant changes in Python between Versions 2.0 and 2.3.3:
Importing a module is case-sensitive on Windows systems—the case of the file name must match the case of the import statement.
The localtime method of the time module defaults to the current time.
A function can now take attributes. For example,
def f(): print 'Hello world' f.counter = 3
Previous versions of Python used three scope levels to resolve a name—local, global, and builtin. As a result, names in intermediate levels of scope could not be seen. To address this limitation, Python Version 2.3.3 searches each namespace to resolve a name.
Python integer and long operations that used to raise an OverflowError exception now return a long integer. In addition, long may be used as an argument in place of int.
The function pop(key) returns the value associated with key and removes it from the dictionary.
The functionality of slicing a sequence has been extended; for example,
'hello world'[::-1] 'dlrow olleh'
The function apply() is now deprecated. Replace existing apply() statements:
apply(func, args, kargs)with the new form:
func(*args, **kargs)
It is now easier to iterate through a file; for example,
for line in file: print line
String searching has been enhanced; for example,
'abc' in 'abcdefg' True
Python Version 2.3 introduced a native Boolean type that is written as True or False. The type of this Boolean is <type 'bool'>. Future releases of the ABAQUS Scripting Interface will use this Python Boolean by default.
In preparation for this change, any method that takes an ABAQUS Boolean as an argument (ON and OFF or TRUE and FALSE) will also accept the equivalent Python Boolean in ABAQUS Version 6.6. It is recommended that you begin using the new Python Boolean in your ABAQUS Scripting Interface scripts and that you convert existing scripts to use the Python Boolean.
Only compiled Python programs must be recompiled. Other custom Python source code will be compiled each time it is used with ABAQUS Version 6.6.
Reference: