2017-03-08 2 views
1

나는 파이썬 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 

는 .history를 .replay_memory .OPS

가 그 모듈을 받고있다을 .base? 그들은 이전 모듈 중 하나의 서브 세트로 그들을 얻고 있습니까?

+2

https://docs.python.org/2.5/whatsnew/pep-328.html – BallpointBen

+0

에 http : // stackoverflow.com/questions/7279810/what-does-a-in-an-import-statement-in-python-mean – plasmon360

답변

3

상대적 가져 오기는 here을 참조하고 동일한 디렉토리에있는 모듈 또는 패키지를 나타냅니다. (더 정확하게, 가장 그러나 not all가지 경우에 같은 일이 될 것 같은 패키지, 인치)