728x90
반응형
1. (module_name).__file__
ex,
>>> import pandas
>>> pandas.__file__
'/home/user/.local/lib/python3.8/site-packages/pandas/__init__.py'
2. os.path.abspath()
ex,
>>> import os
>>> os.path.abspath(pandas.__file__)
'/home/user/.local/lib/python3.8/site-packages/pandas/__init__.py'
* module directory
>>> os.path.dirname(pandas.__file__)
'/home/user/.local/lib/python3.8/site-packages/pandas'
3. inspect module
ex,
>>> import inspect
>>> inspect.getfile(pandas)
'/home/user/.local/lib/python3.8/site-packages/pandas/__init__.py'
728x90
반응형
'개발 > Python' 카테고리의 다른 글
Google Colab (Colaboratory) python library module install, upgrade, uninstall (0) | 2021.05.01 |
---|---|
Python online compiler (0) | 2021.04.29 |
A Byte of Python (0) | 2021.04.22 |
PIP python package library version find (0) | 2021.04.20 |
PyCharm plugin Code With Me disable (conflict Kite) (0) | 2021.04.20 |