注:同样可以用来处理importError问题。
1. 重构python解释器(仅限8.0.0版本)
可以用本地的python 2.7环境来取代SecureCRT本身的解释器
感谢这位博主的两篇博文。
SecureCRT调用python脚本ImportError https://blog.csdn.net/MrRight17/article/details/82527407 SecureCRT脚本环境类(python)https://blog.csdn.net/MrRight17/article/details/82874479但是之后的版本之中,改为了vpython.zip 和 vpython.dll就不适用了。 (这里是笔者水平不行。。是在不会)
2. 简单的解决办法,引入模块路径
参考论坛: https://forums.vandyke.com/printthread.php?t=10331 (使用chrome打开会自动机翻成中文,不如不翻译。。。)
To load a module in a Python script started in SecureCRT you must place the module in a valid path. Valid paths are defined in the sys.path list. If you don't want to use the paths in the list, you can modify sys.path. Here is an example of how one can modify sys.path to look for the module in the same location as the script: Code: import sys
In my tests, I had to use .py rather than .fy for the module name extension. |