简体   繁体   English

“ from import”语句中的python点运算符

[英]python dot operator in 'from import' statement

from . import _nd_image

My question is that there is no such file _nd_image.py in the current directory and code uses this above import statement and below, somewhere in code there is a statement _nd_image.fun() . 我的问题是,当前目录中没有这样的文件_nd_image.py,代码在import语句上方和下面使用此代码,在代码中的某处有_nd_image.fun()语句。

How is it possible to import a file which is not present in the directory and use it to call some function. 如何导入目录中不存在的文件并使用它调用某些功能。

The code is taken from here 代码是从这里获取的

import statement in at line no.36 

and usage of _nd_image is at line no. _nd_image的用法在第no行。 143 143

There is probably a file _nd_image.pyd or _nd_image.so in the directory. 目录中可能有一个文件_nd_image.pyd_nd_image.so This is a Python extension library written in C. These files act as normal Python modules that can be imported. 这是用C编写的Python扩展库。这些文件充当可以导入的常规Python模块。 See here and here for more info. 有关更多信息,请参见此处此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM