简体   繁体   中英

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() .

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. 143

There is probably a file _nd_image.pyd or _nd_image.so in the directory. This is a Python extension library written in C. These files act as normal Python modules that can be imported. See here and here for more info.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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