1、配置环境
支持python2和python3
On Linux, Solaris, or FreeBSD, add the /usr/local/staf/lib directory to your PYTHONPATH, assuming you installed STAF to directory /usr/local/staf. For example:
export PYTHONPATH=/usr/local/staf/lib:$PYTHONPATH
On Mac OS X, add the /Library/staf/lib directory to your PYTHONPATH, assuming you installed STAF to directory /Library/staf. For example:
On Windows, add the C:\STAF\bin directory to your PYTHONPATH, assuming you installed STAF to directory C:\STAF. For example:
set PYTHONPATH=C:\STAF\bin;%PYTHONPATH%
2、python代码
from PySTAF import STAFHandle
from PySTAF import STAFException
import sys
try:
handle = STAFHandle("MyTest")
except STAFException, e:
print