Issuing Commands in the Python Console
In addition to scripts, you can use the API commands in a Python 3 console. To run in a console, you need to import packages, set up paths, and import the API before using API commands. To open a Python 3 console:
Open Console in Linux
> source bin/setup.sh // set up environment
> python3 // open consoleOpen Console in Windows
> bin\setup.bat // set up environment
> efx_run_pt_script.bat // use helper file to open consoleImport Packages, Set up Paths, and Import API
> import os // import operating system package
> import sys // import system package
> pt_home = os.environ['EFXPT_HOME'] // set environment
> sys.path.append(pt_home + "/bin") // set path
> from api_service.design import DesignAPI // import the API
> design = DesignAPI(is_verbose=True) // turn on verbose messagesUse API Commands
> design.load("./pt_demo.peri.xml")
> rstn = design.get_gpio("rstn")