什么是.在Python中的import语句中是什么意思? [英] What does a . in an import statement in Python mean?

查看:398
本文介绍了什么是.在Python中的import语句中是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看Python的multiprocessing模块的代码,其中包含以下行:

I'm looking over the code for Python's multiprocessing module, and it contains this line:

from ._multiprocessing import win32, Connection, PipeConnection

代替

from _multiprocessing import win32, Connection, PipeConnection

细微差别是_multiprocessing之前的时期.那是什么意思?为什么要月经?

the subtle difference being the period before _multiprocessing. What does that mean? Why the period?

推荐答案

这是显式相对进口.这意味着从当前程序包导入.

That's the new syntax for explicit relative imports. It means import from the current package.

这篇关于什么是.在Python中的import语句中是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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