在 Python 中导入 .意思?

Importing in Python what does the . mean?

我正在尝试遵循 python 3.5 中的一些代码,但我仍然是超级新手级别。

我有以下导入,但我不确定与以“.”开头的导入有什么区别?

import os
import time
import random
import numpy as np
from tqdm import tqdm
import tensorflow as tf

from .base import BaseModel
from .history import History
from .replay_memory import ReplayMemory
from .ops import linear, conv2d, clipped_error
from utils import get_time, save_pkl, load_pkl

例如.base .history .replay_memory .ops

它从哪里获得这些模块?他们是否将它们作为早期模块之一的子集?

它是所谓的相对导入,参见 here,指的是位于同一目录中的模块或包。 (更准确地说,在同一个包中,在大多数情况下 not all 情况下是相同的。)