민서네집

How to get python module(file) location (inspect 모듈 사용) 본문

Python

How to get python module(file) location (inspect 모듈 사용)

브라이언7 2016. 8. 21. 15:53

Where is python tensorflow mnist source file


$ python -m tensorflow.models.image.mnist.convolutional  (Execution)


How to get Python module(file) location


$ python -c "import os; import inspect; import tensorflow; print(os.path.dirname(inspect.getfile(tensorflow)))"


[Result] /usr/local/lib/python2.7/dist-packages/tensorflow


$ python -c "import os; import inspect; from tensorflow.models.image.mnist import convolutional; print(os.path.dirname(inspect.getfile(convolutional)))"


[Result] /usr/local/lib/python2.7/dist-packages/tensorflow/models/image/mnist


Comments