0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Pythonでのモジュールのインポート

Last updated at Posted at 2019-08-09

importはsys.modules(モジュールキャッシュ、すでに読み込まれているモジュールとモジュール名がマップされた辞書)から検索を始める。以下でキャッシュの内容を確認できる。

python
>>> import sys
>>> sys.modules
{'builtins'': <module 'builtins' (built-in)>, 'sys': <module 'sys' (built-in)>, '_frozen_importlib': <module 'importlib._bootstrap' (frozen)>, '_imp': <module '_imp' (built-in)>, '_warnings': <module '_warnings' (built-in)>, ...'>}
>>> sys
<module 'sys' (built-in)>
python
# (>>> import pandasをして確認すると...、大量なのでここには載せない)
>>> pandas
<module 'pandas' from '...anaconda3-5.2.0/lib/python3.6/site-packages/pandas/__init__.py'>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?