Python:导入_io [英] Python: import _io

查看:219
本文介绍了Python:导入_io的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试确定Python库中哪些文件对于运行脚本绝对是必不可少的.现在,我正在尝试确定_io.py的位置.在io.py(不带下划线)中,_io.py模块(带下划线)在第60行导入.

I'm trying to determine which files in the Python library are strictly necessary for my script to run. Right now I'm trying to determine where _io.py is located. In io.py (no underscore), the _io.py module (with underscore) is imported on line 60.

推荐答案

某些模块直接编译到解释器中-没有与之对应的文件.您可以从 sys.builtin_module_names 中检索这些模块的列表.在我的Pyton 3.1安装中,_io包含在此列表中.

Some modules are compiled directly into the interpreter -- there are no files corresponding to them. You can retrieve a list of these modules from sys.builtin_module_names. In my Pyton 3.1 installation, _io is included in this list.

您可能想看看 snakefood ,以确定脚本的依赖性.

You might want to have a look at snakefood to determine the dependencies of your script.

这篇关于Python:导入_io的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆