These examples provide techniques for importing your custom-written Python modules that need to reference the crt scripting object.
To be clear, this approach does not allow scripts running outside of SecureCRT to access the crt scripting object. The crt script object is not available to any process outside of the SecureCRT process itself. SecureCRT populates the script engine with the crt object at runtime; so unless SecureCRT is running the script itself, there is no crt object available to any script engine.
This approach simply allows you to modularize elements of your existing SecureCRT scripts — scripts that must continue to be run from within the SecureCRT process itself.
ImportModuleWith_crt_Reference.py.txt (4.0 KB)
This is the main Python script code. It imports the crt_Module code. The script will work in either Python 2.7 or 3.x.
crt_Module.py.txt (953 Bytes)
This file contains the module code itself. This module is imported by the main script code.
Here you can control cookies using the checkboxes below. Some cookies are essential for the use of our website and cannot be disabled. Others provide a convenience to the user and, if disabled, may reduce the ease of use of our site. Finally, some cookies provide anonymous analytic tracking data that help us provide the user with a richer browsing experience. You can elect to disable these cookies as well.