- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to locate a particular module in Python?
For a pure python module you can find the location of the source files by looking at the module.__file__. For example,
>>> import mymodule >>> mymodule.__file__ C:/Users/Ayush/mymodule.py
Many built in modules, however, are written in C, and therefore module.__file__ points to a .so file (there is no module.__file__ on Windows), and therefore, you can't see the source.
Running "python -v" from the command line tells you what is being imported and from where. This is useful if you want to know the location of built in modules.
- How to locate descendant elements of a particular type of elements in jQuery?
- How to locate all the descendant elements of a particular type of element?
- How to develop a Python Module?
- How to install a Python Module?
- How to write a python module?
- How to list all functions in a Python module?
- Import a module in Python
- How to retrieve Python module path?
- How to import a single function from a Python module?
- How to locate the median in a (Seaborn) KDE plot?
- How to delete an installed module in Python?
- How to use the Subprocess Module in Python?
- Java Program to locate a character in a string
- Java Program to locate a substring in a string
- How do I unload (reload) a Python module?