Print The File Path Of Imported Modules.














































Print The File Path Of Imported Modules.



If you want to know the absolute location of modules imported in your code, then use the below trick.
import threading 
import socket

print(threading)
print(socket)

#1- <module 'threading' from '/usr/lib/python2.7/threading.py'>
#2- <module 'socket' from '/usr/lib/python2.7/socket.py'>

Comments