MCPcopy Create free account
hub / github.com/ipython/ipython / get_ipython_module_path

Function get_ipython_module_path

IPython/paths.py:94–106  ·  view source on GitHub ↗

Find the path to an IPython module in this version of IPython. This will always find the version of the module that is in this importable IPython package. This will always return the path to the ``.py`` version of the module.

(module_str)

Source from the content-addressed store, hash-verified

92
93
94def get_ipython_module_path(module_str):
95 """Find the path to an IPython module in this version of IPython.
96
97 This will always find the version of the module that is in this importable
98 IPython package. This will always return the path to the ``.py``
99 version of the module.
100 """
101 if module_str == 'IPython':
102 return os.path.join(get_ipython_package_dir(), '__init__.py')
103 mod = import_item(module_str)
104 the_path = mod.__file__.replace('.pyc', '.py')
105 the_path = the_path.replace('.pyo', '.py')
106 return py3compat.cast_unicode(the_path, fs_encoding)
107
108def locate_profile(profile='default'):
109 """Find the path to the folder associated with a given profile.

Callers 1

get_ipython_module_pathFunction · 0.90

Calls 2

import_itemFunction · 0.90
get_ipython_package_dirFunction · 0.70

Tested by

no test coverage detected