编程开发
C/C++
关闭 VS 的符合模式
typedef 与 define
GO
环境安装及修改路径
go 基础
解决go get 下载github项目慢或无法下载的问题
ASCII 码一览表
桌面应用开发 electron
electron ipc通信有啥用
const { app, BrowserWindow, ipcMain, dialog } = require('electron') 的解析
electron 常用模块介绍
Electron 项目解析
前端
python
植入获取当前python脚本所用到的依赖
本文档使用 MrDoc 发布
-
+
首页
植入获取当前python脚本所用到的依赖
```python # 获取包含子项的导入表 import sys import atexit def log_imports(): with open("imported_modules.log", "w") as f: for name, module in sorted(sys.modules.items()): if hasattr(module, "__file__") and module.__file__: f.write(f"{name}\n") atexit.register(log_imports) # 获取不包含子项的导入表 import sys import atexit def log_imports(): top_level_modules = set() for name in sys.modules: # Split the module name by dots and take the first part top_level = name.split('.')[0] top_level_modules.add(top_level) with open("imported_modules.log", "w") as f: for module in sorted(top_level_modules): f.write(f"{module}\n") atexit.register(log_imports) ```
别卷了
2025年4月17日 14:15
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
Markdown文件
PDF文档(打印)
分享
链接
类型
密码
更新密码