tcl/tk safe - 2 - Safe Base

本文介绍了TCL的Safe Base,它是安全模式解释器的一种扩展,允许在子解释器中执行脚本文件和操作包,但需主解释器授权,并且限制了exit命令,确保子解释器退出不会影响主程序。

在上一篇http://blog.youkuaiyun.com/msptop/archive/2008/03/31/2233187.aspx 中介绍了关于安全模式的解释器基本特性。然而这些特性太简单太原始,没有脚本库环境,使用起来需要构造大量的额外代码,才能正确执行所需功能。

本节将会介绍tcl提供的已经封装好的安全模式解释器The Safe Base。Safe Base是原始安全模式的扩展,在这种扩展模式下,可以在子解释器中执行脚本文件(source命令)和操作包(package 命令),但是这些操作需要主解释器的授权,它只能访问在主解释器中定义的路径下的文件。并且它也“覆盖”了exit命令。在这种模式下,若执行exit,则子解释器自行销毁并不会波及主程序。

Safe Base的有关命令如下表:

safe::interpCreate slave options?

创建一个Safe Base模式名为slave的解释器

safe::interpInit slave options?

初始化一个安全模式的解释器

safe::interpConfigure slave options?

配置Safe Base模式的解释器,支持属性:-accessPath pathlist, -nostatics, -deleteHook script, -nestedLoadOk

safe::interpDelete slave

删除SafeBase模式的解释器slave

safe::interpAddToAccessPath slave directory

为slave添加授权访问路径

safe::interpFindInAccessPath slave path

返回授权访问路径的符号(用于标识该路径)

safe::setLogCmd cmd? arg?...

若没有参数则返回所有在改解释器中执行过的命令与history类似,若有参数,则将该参数加入记录在解释器中执行过命令的log

 

Safe Base中的命令别名:

source

在授权访问路径中执行脚本

load

在授权访问路径中导入二进制库

file

只有dirname, join, extension, root, tail, pathname, and split 这些操作被允许

exit

销毁调用

(myenv) PS D:\PythonItem> pyinstaller -F -w -i icon.ico 午夜赛出战.py 67 INFO: PyInstaller: 6.17.0, contrib hooks: 2025.10 68 INFO: Python: 3.14.0 80 INFO: Platform: Windows-10-10.0.19045-SP0 80 INFO: Python environment: D:\PythonItem\.venv 81 INFO: wrote D:\PythonItem\午夜赛出战.spec 83 INFO: Module search paths (PYTHONPATH): ['D:\\PythonItem\\.venv\\Scripts\\pyinstaller.exe', 'D:\\PythonItem\\.venv\\Scripts\\python314.zip', 'D:\\Python\\DLLs', 'D:\\Python\\Lib', 'D:\\Python', 'D:\\PythonItem\\.venv', 'D:\\PythonItem\\.venv\\Lib\\site-packages', 'D:\\PythonItem'] 274 INFO: checking Analysis 274 INFO: Building Analysis because Analysis-00.toc is non existent 274 INFO: Looking for Python shared library... 275 INFO: Using Python shared library: D:\PythonItem\.venv\Scripts\python314.dll 275 INFO: Running Analysis Analysis-00.toc 275 INFO: Target bytecode optimization level: 0 275 INFO: Initializing module dependency graph... 276 INFO: Initializing module graph hook caches... 284 INFO: Analyzing modules for base_library.zip ... 1116 INFO: Processing standard module hook 'hook-encodings.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 1374 INFO: Processing standard module hook 'hook-pickle.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 1599 INFO: Processing standard module hook 'hook-difflib.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 1607 INFO: Processing standard module hook 'hook-heapq.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 3210 INFO: Caching module dependency graph... 3231 INFO: Analyzing D:\PythonItem\午夜赛出战.py 3243 INFO: Processing standard module hook 'hook-idlelib.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 3287 INFO: Processing pre-find-module-path hook 'hook-tkinter.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path' 3287 INFO: TclTkInfo: initializing cached Tcl/Tk info... 3516 INFO: Processing standard module hook 'hook-_tkinter.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 3777 INFO: Processing standard module hook 'hook-multiprocessing.util.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 3849 INFO: Processing standard module hook 'hook-xml.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 4022 INFO: Processing standard module hook 'hook-_ctypes.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 4364 INFO: Processing standard module hook 'hook-platform.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 4558 INFO: Processing standard module hook 'hook-sysconfig.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 4615 INFO: Processing standard module hook 'hook-setuptools.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 4616 INFO: SetuptoolsInfo: initializing cached setuptools info... 6530 INFO: Processing pre-safe-import-module hook 'hook-distutils.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module' 6552 INFO: Processing pre-safe-import-module hook 'hook-jaraco.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module' 6553 INFO: Setuptools: 'jaraco' appears to be a full setuptools-vendored copy - creating alias to 'setuptools._vendor.jaraco'! 6559 INFO: Processing pre-safe-import-module hook 'hook-more_itertools.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module' 6559 INFO: Setuptools: 'more_itertools' appears to be a setuptools-vendored copy - creating alias to 'setuptools._vendor.more_itertools'! 6633 INFO: Processing pre-safe-import-module hook 'hook-typing_extensions.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module' 6633 INFO: Setuptools: 'typing_extensions' appears to be a setuptools-vendored copy - creating alias to 'setuptools._vendor.typing_extensions'! 6752 INFO: Processing pre-safe-import-module hook 'hook-packaging.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module' 6868 INFO: Processing standard module hook 'hook-setuptools._vendor.jaraco.text.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 6868 INFO: Processing pre-safe-import-module hook 'hook-importlib_resources.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module' 6874 INFO: Processing pre-safe-import-module hook 'hook-backports.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module' 6874 INFO: Setuptools: 'backports' appears to be a full setuptools-vendored copy - creating alias to 'setuptools._vendor.backports'! 6986 INFO: Processing pre-safe-import-module hook 'hook-importlib_metadata.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module' 6986 INFO: Setuptools: 'importlib_metadata' appears to be a setuptools-vendored copy - creating alias to 'setuptools._vendor.importlib_metadata'! 7007 INFO: Processing standard module hook 'hook-setuptools._vendor.importlib_metadata.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 7008 INFO: Processing pre-safe-import-module hook 'hook-zipp.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module' 7008 INFO: Setuptools: 'zipp' appears to be a setuptools-vendored copy - creating alias to 'setuptools._vendor.zipp'! 7161 INFO: Processing pre-safe-import-module hook 'hook-tomli.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module' 7162 INFO: Setuptools: 'tomli' appears to be a setuptools-vendored copy - creating alias to 'setuptools._vendor.tomli'! 7489 INFO: Processing pre-safe-import-module hook 'hook-wheel.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module' 7490 INFO: Setuptools: 'wheel' appears to be a setuptools-vendored copy - creating alias to 'setuptools._vendor.wheel'! 8397 INFO: Processing standard module hook 'hook-openpyxl.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\stdhooks' 8450 INFO: Processing standard module hook 'hook-numpy.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 10050 INFO: Processing standard module hook 'hook-xml.etree.cElementTree.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 10279 INFO: Processing standard module hook 'hook-PIL.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 10355 INFO: Processing standard module hook 'hook-PIL.Image.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 10632 INFO: Processing standard module hook 'hook-PIL.ImageFilter.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 11069 INFO: Processing module hooks (post-graph stage)... 11275 INFO: Processing standard module hook 'hook-PIL.SpiderImagePlugin.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 11548 INFO: Processing standard module hook 'hook-_tkinter.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks' 11558 INFO: Performing binary vs. data reclassification (969 entries) 11649 INFO: Looking for ctypes DLLs 11690 INFO: Analyzing run-time hooks ... 11694 INFO: Including run-time hook 'pyi_rth_inspect.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks' 11696 INFO: Including run-time hook 'pyi_rth_pkgutil.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks' 11697 INFO: Including run-time hook 'pyi_rth_multiprocessing.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks' 11698 INFO: Including run-time hook 'pyi_rth_setuptools.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks' 11699 INFO: Including run-time hook 'pyi_rth__tkinter.py' from 'D:\\PythonItem\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks' 11720 INFO: Creating base_library.zip... 11731 INFO: Looking for dynamic libraries 12088 INFO: Extra DLL search directories (AddDllDirectory): ['D:\\PythonItem\\.venv\\Lib\\site-packages\\numpy.libs'] 12088 INFO: Extra DLL search directories (PATH): [] 12323 INFO: Warnings written to D:\PythonItem\build\午夜赛出战\warn-午夜赛出战.txt 12362 INFO: Graph cross-reference written to D:\PythonItem\build\午夜赛出战\xref-午夜赛出战.html 12383 INFO: checking PYZ 12383 INFO: Building PYZ because PYZ-00.toc is non existent 12383 INFO: Building PYZ (ZlibArchive) D:\PythonItem\build\午夜赛出战\PYZ-00.pyz 12699 INFO: Building PYZ (ZlibArchive) D:\PythonItem\build\午夜赛出战\PYZ-00.pyz completed successfully. 12714 INFO: checking PKG 12714 INFO: Building PKG because PKG-00.toc is non existent 12714 INFO: Building PKG (CArchive) 午夜赛出战.pkg 14785 INFO: Building PKG (CArchive) 午夜赛出战.pkg completed successfully. 14793 INFO: Bootloader D:\PythonItem\.venv\Lib\site-packages\PyInstaller\bootloader\Windows-64bit-intel\runw.exe 14793 INFO: checking EXE 14793 INFO: Building EXE because EXE-00.toc is non existent 14793 INFO: Building EXE from EXE-00.toc 14794 INFO: Copying bootloader EXE to D:\PythonItem\dist\午夜赛出战.exe 14795 INFO: Copying icon to EXE Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "D:\PythonItem\.venv\Scripts\pyinstaller.exe\__main__.py", line 7, in <module> sys.exit(_console_script_run()) ~~~~~~~~~~~~~~~~~~~^^ File "D:\PythonItem\.venv\Lib\site-packages\PyInstaller\__main__.py", line 231, in _console_script_run run() ~~~^^ File "D:\PythonItem\.venv\Lib\site-packages\PyInstaller\__main__.py", line 215, in run run_build(pyi_config, spec_file, **vars(args)) ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\PythonItem\.venv\Lib\site-packages\PyInstaller\__main__.py", line 70, in run_build PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\PythonItem\.venv\Lib\site-packages\PyInstaller\building\build_main.py", line 1272, in main build(specfile, distpath, workpath, clean_build) ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\PythonItem\.venv\Lib\site-packages\PyInstaller\building\build_main.py", line 1210, in build exec(code, spec_namespace) ~~~~^^^^^^^^^^^^^^^^^^^^^^ File "D:\PythonItem\午夜赛出战.spec", line 19, in <module> exe = EXE( pyz, ...<17 lines>... icon=['icon.ico'], ) File "D:\PythonItem\.venv\Lib\site-packages\PyInstaller\building\api.py", line 675, in __init__ self.__postinit__() ~~~~~~~~~~~~~~~~~^^ File "D:\PythonItem\.venv\Lib\site-packages\PyInstaller\building\datastruct.py", line 184, in __postinit__ self.assemble() ~~~~~~~~~~~~~^^ File "D:\PythonItem\.venv\Lib\site-packages\PyInstaller\building\api.py", line 788, in assemble self._retry_operation(icon.CopyIcons, build_name, self.icon) ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\PythonItem\.venv\Lib\site-packages\PyInstaller\building\api.py", line 1058, in _retry_operation return func(*args) File "D:\PythonItem\.venv\Lib\site-packages\PyInstaller\utils\win32\icon.py", line 206, in CopyIcons srcpath = normalize_icon_type(srcpath, ("exe", "ico"), "ico", config.CONF["workpath"]) File "D:\PythonItem\.venv\Lib\site-packages\PyInstaller\building\icon.py", line 34, in normalize_icon_type raise FileNotFoundError(f"Icon input file {icon_path} not found") FileNotFoundError: Icon input file D:\PythonItem\icon.ico not found什么问题
11-26
Microsoft Windows [版本 10.0.19045.5608] (c) Microsoft Corporation。保留所有权利。 F:\789>BUILD_EXE.PY 正在准备构建环境... 安装依赖... Looking in indexes: https://mirrors.aliyun.com/pypi/simple/ Requirement already satisfied: pandas in d:\python\py3.13\lib\site-packages (2.3.0) Requirement already satisfied: openpyxl in d:\python\py3.13\lib\site-packages (3.1.5) Requirement already satisfied: tabulate in d:\python\py3.13\lib\site-packages (0.9.0) Requirement already satisfied: pyinstaller in d:\python\py3.13\lib\site-packages (6.14.1) Requirement already satisfied: pillow in d:\python\py3.13\lib\site-packages (11.2.1) Collecting tkinterdnd2 Downloading https://mirrors.aliyun.com/pypi/packages/08/c3/e04f004a53c00dc01126b6f998264cef672c6883c36aa4bd65845a8eb4c0/tkinterdnd2-0.4.3-py3-none-any.whl (493 kB) Requirement already satisfied: numpy>=1.26.0 in d:\python\py3.13\lib\site-packages (from pandas) (2.3.1) Requirement already satisfied: python-dateutil>=2.8.2 in d:\python\py3.13\lib\site-packages (from pandas) (2.9.0.post0) Requirement already satisfied: pytz>=2020.1 in d:\python\py3.13\lib\site-packages (from pandas) (2025.2) Requirement already satisfied: tzdata>=2022.7 in d:\python\py3.13\lib\site-packages (from pandas) (2025.2) Requirement already satisfied: et-xmlfile in d:\python\py3.13\lib\site-packages (from openpyxl) (2.0.0) Requirement already satisfied: setuptools>=42.0.0 in d:\python\py3.13\lib\site-packages (from pyinstaller) (80.9.0) Requirement already satisfied: altgraph in d:\python\py3.13\lib\site-packages (from pyinstaller) (0.17.4) Requirement already satisfied: pefile!=2024.8.26,>=2022.5.30 in d:\python\py3.13\lib\site-packages (from pyinstaller) (2023.2.7) Requirement already satisfied: pywin32-ctypes>=0.2.1 in d:\python\py3.13\lib\site-packages (from pyinstaller) (0.2.3) Requirement already satisfied: pyinstaller-hooks-contrib>=2025.4 in d:\python\py3.13\lib\site-packages (from pyinstaller) (2025.5) Requirement already satisfied: packaging>=22.0 in d:\python\py3.13\lib\site-packages (from pyinstaller) (25.0) Requirement already satisfied: six>=1.5 in d:\python\py3.13\lib\site-packages (from python-dateutil>=2.8.2->pandas) (1.17.0) Installing collected packages: tkinterdnd2 Successfully installed tkinterdnd2-0.4.3 应用图标已创建 开始打包... 6173 INFO: PyInstaller: 6.14.1, contrib hooks: 2025.5 6173 INFO: Python: 3.13.3 6209 INFO: Platform: Windows-10-10.0.19045-SP0 6209 INFO: Python environment: D:\python\py3.13 6211 INFO: wrote F:\789\TableToMD.spec 6214 INFO: Removing temporary files and cleaning cache in C:\Users\0\AppData\Local\pyinstaller 6216 INFO: Module search paths (PYTHONPATH): ['F:\\789', 'D:\\python\\py3.13\\python313.zip', 'D:\\python\\py3.13\\DLLs', 'D:\\python\\py3.13\\Lib', 'D:\\python\\py3.13', 'D:\\python\\py3.13\\Lib\\site-packages', 'D:\\python\\py3.13\\Lib\\site-packages\\setuptools\\_vendor', 'F:\\789'] 7096 INFO: Appending 'datas' from .spec 7096 INFO: checking Analysis 7097 INFO: Building Analysis because Analysis-00.toc is non existent 7097 INFO: Running Analysis Analysis-00.toc 7097 INFO: Target bytecode optimization level: 0 7098 INFO: Initializing module dependency graph... 7099 INFO: Initializing module graph hook caches... 7137 INFO: Analyzing modules for base_library.zip ... 8830 INFO: Processing standard module hook 'hook-heapq.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 9191 INFO: Processing standard module hook 'hook-encodings.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 11186 INFO: Processing standard module hook 'hook-pickle.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 12917 INFO: Caching module dependency graph... 12954 INFO: Looking for Python shared library... 12974 INFO: Using Python shared library: D:\python\py3.13\python313.dll 12975 INFO: Analyzing F:\789\table_to_md.py 13040 INFO: Processing standard module hook 'hook-pandas.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 15345 INFO: Processing standard module hook 'hook-platform.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 15455 INFO: Processing standard module hook 'hook-sysconfig.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 15522 INFO: Processing standard module hook 'hook-numpy.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 16434 INFO: Processing standard module hook 'hook-difflib.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 16776 INFO: Processing standard module hook 'hook-multiprocessing.util.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 17001 INFO: Processing standard module hook 'hook-xml.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 19675 INFO: Processing pre-safe-import-module hook 'hook-typing_extensions.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module' 19689 INFO: SetuptoolsInfo: initializing cached setuptools info... 24695 INFO: Processing standard module hook 'hook-charset_normalizer.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\stdhooks' 25329 INFO: Processing standard module hook 'hook-pytz.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 28322 INFO: Processing standard module hook 'hook-pandas.io.formats.style.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 30856 INFO: Processing standard module hook 'hook-pandas.plotting.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 31746 INFO: Processing standard module hook 'hook-openpyxl.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\stdhooks' 31993 INFO: Processing standard module hook 'hook-lxml.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\stdhooks' 32622 INFO: Processing standard module hook 'hook-lxml.etree.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\stdhooks' 32885 INFO: Processing standard module hook 'hook-xml.etree.cElementTree.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 33332 INFO: Processing standard module hook 'hook-PIL.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 33454 INFO: Processing standard module hook 'hook-PIL.Image.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 34198 INFO: Processing standard module hook 'hook-PIL.ImageFilter.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 35938 INFO: Processing standard module hook 'hook-sqlite3.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 36474 INFO: Processing standard module hook 'hook-pandas.io.clipboard.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 36845 INFO: Processing standard module hook 'hook-dateutil.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\stdhooks' 37119 INFO: Processing pre-safe-import-module hook 'hook-six.moves.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module' 37549 INFO: Processing standard module hook 'hook-xml.dom.domreg.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 38305 INFO: Processing pre-find-module-path hook 'hook-tkinter.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path' 38309 INFO: TclTkInfo: initializing cached Tcl/Tk info... 38898 INFO: Processing standard module hook 'hook-_tkinter.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 38996 INFO: Processing standard module hook 'hook-tkinterdnd2.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\stdhooks' 39036 INFO: Analyzing hidden import 'xlwt' 39037 ERROR: Hidden import 'xlwt' not found 39038 INFO: Processing module hooks (post-graph stage)... 39258 INFO: Processing standard module hook 'hook-lxml.isoschematron.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\stdhooks' 39283 WARNING: Hidden import "jinja2" not found! 39592 INFO: Processing standard module hook 'hook-PIL.SpiderImagePlugin.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 39653 INFO: Processing standard module hook 'hook-_tkinter.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks' 39655 INFO: Processing standard module hook 'hook-lxml.objectify.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\stdhooks' 39673 INFO: Performing binary vs. data reclassification (1560 entries) 40208 INFO: Looking for ctypes DLLs 40268 INFO: Analyzing run-time hooks ... 40273 INFO: Including run-time hook 'pyi_rth_inspect.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks' 40282 INFO: Including run-time hook 'pyi_rth_pkgutil.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks' 40285 INFO: Including run-time hook 'pyi_rth_multiprocessing.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks' 40287 INFO: Including run-time hook 'pyi_rth__tkinter.py' from 'D:\\python\\py3.13\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks' 40338 INFO: Creating base_library.zip... 40379 INFO: Looking for dynamic libraries 41975 INFO: Extra DLL search directories (AddDllDirectory): ['D:\\python\\py3.13\\Lib\\site-packages\\numpy.libs', 'D:\\python\\py3.13\\Lib\\site-packages\\pandas.libs'] 41975 INFO: Extra DLL search directories (PATH): [] 44927 INFO: Warnings written to F:\789\build\TableToMD\warn-TableToMD.txt 45012 INFO: Graph cross-reference written to F:\789\build\TableToMD\xref-TableToMD.html 45081 INFO: checking PYZ 45082 INFO: Building PYZ because PYZ-00.toc is non existent 45082 INFO: Building PYZ (ZlibArchive) F:\789\build\TableToMD\PYZ-00.pyz 46228 INFO: Building PYZ (ZlibArchive) F:\789\build\TableToMD\PYZ-00.pyz completed successfully. 46332 INFO: checking PKG 46332 INFO: Building PKG because PKG-00.toc is non existent 46333 INFO: Building PKG (CArchive) TableToMD.pkg 56140 INFO: Building PKG (CArchive) TableToMD.pkg completed successfully. 56162 INFO: Bootloader D:\python\py3.13\Lib\site-packages\PyInstaller\bootloader\Windows-64bit-intel\run.exe 56162 INFO: checking EXE 56163 INFO: Building EXE because EXE-00.toc is non existent 56163 INFO: Building EXE from EXE-00.toc 56163 INFO: Copying bootloader EXE to F:\789\dist\TableToMD.exe 56203 INFO: Copying icon to EXE 56210 INFO: Copying 0 resources to EXE 56210 INFO: Embedding manifest in EXE 56217 INFO: Appending PKG archive to EXE 56278 INFO: Fixing EXE headers 56752 INFO: Building EXE from EXE-00.toc completed successfully. 56774 INFO: Build complete! The results are available in: F:\789\dist 构建完成! EXE文件在 dist 目录中 运行 TableToMD.exe 启动程序 为什么启动程序没有应用界面呢?
06-23
【完美复现】面向配电网韧性提升的移动储能预布局与动态调度策略【IEEE33节点】(Matlab代码实现)内容概要:本文介绍了基于IEEE33节点的配电网韧性提升方法,重点研究了移动储能系统的预布局与动态调度策略。通过Matlab代码实现,提出了一种结合预配置和动态调度的两阶段优化模型,旨在应对电网故障或极端事件时快速恢复供电能力。文中采用了多种智能优化算法(如PSO、MPSO、TACPSO、SOA、GA等)进行对比分析,验证所提策略的有效性和优越性。研究不仅关注移动储能单元的初始部署位置,还深入探讨其在故障发生后的动态路径规划与电力支援过程,从而全面提升配电网的韧性水平。; 适合人群:具备电力系统基础知识和Matlab编程能力的研究生、科研人员及从事智能电网、能源系统优化等相关领域的工程技术人员。; 使用场景及目标:①用于科研复现,特别是IEEE顶刊或SCI一区论文中关于配电网韧性、应急电源调度的研究;②支撑电力系统在灾害或故障条件下的恢复力优化设计,提升实际电网应对突发事件的能力;③为移动储能系统在智能配电网中的应用提供理论依据和技术支持。; 阅读建议:建议读者结合提供的Matlab代码逐模块分析,重点关注目标函数建模、约束条件设置以及智能算法的实现细节。同时推荐参考文中提及的MPS预配置与动态调度上下两部分,系统掌握完整的技术路线,并可通过替换不同算法或测试系统进一步拓展研究。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值