【问题标题】:python dot operator in 'from import' statement'from import'语句中的python点运算符
【发布时间】:2014-09-24 07:03:42
【问题描述】:
from . import _nd_image

我的问题是当前目录中没有这样的文件_nd_image.py,代码在上面和下面使用这个import语句,在代码的某处有一个语句_nd_image.fun()

如何导入目录中不存在的文件并使用它来调用某些函数。

代码取自here

import statement in at line no.36 

_nd_image 的用法在第 1 行。 143

【问题讨论】:

    标签: python scipy


    【解决方案1】:

    目录中可能有一个文件_nd_image.pyd_nd_image.so。这是一个用 C 编写的 Python 扩展库。这些文件充当可以导入的普通 Python 模块。请参阅herehere 了解更多信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-05
      • 2018-12-08
      • 2016-12-17
      • 2016-06-02
      • 1970-01-01
      相关资源
      最近更新 更多