本文整理汇总了Python中IPython.core.application.BaseIPythonApplication.init_config_files方法的典型用法代码示例。如果您正苦于以下问题:Python BaseIPythonApplication.init_config_files方法的具体用法?Python BaseIPythonApplication.init_config_files怎么用?Python BaseIPythonApplication.init_config_files使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPython.core.application.BaseIPythonApplication
的用法示例。
在下文中一共展示了BaseIPythonApplication.init_config_files方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_unicode_cwd
# 需要导入模块: from IPython.core.application import BaseIPythonApplication [as 别名]
# 或者: from IPython.core.application.BaseIPythonApplication import init_config_files [as 别名]
def test_unicode_cwd():
"""Check that IPython starts with non-ascii characters in the path."""
wd = tempfile.mkdtemp(suffix=u"€")
old_wd = os.getcwdu()
os.chdir(wd)
#raise Exception(repr(os.getcwdu()))
try:
app = BaseIPythonApplication()
# The lines below are copied from Application.initialize()
app.init_profile_dir()
app.init_config_files()
app.load_config_file(suppress_errors=False)
finally:
os.chdir(old_wd)
示例2: test_unicode_ipdir
# 需要导入模块: from IPython.core.application import BaseIPythonApplication [as 别名]
# 或者: from IPython.core.application.BaseIPythonApplication import init_config_files [as 别名]
def test_unicode_ipdir():
"""Check that IPython starts with non-ascii characters in the IP dir."""
ipdir = tempfile.mkdtemp(suffix=u"€")
# Create the config file, so it tries to load it.
with open(os.path.join(ipdir, 'ipython_config.py'), "w") as f:
pass
old_ipdir1 = os.environ.pop("IPYTHONDIR", None)
old_ipdir2 = os.environ.pop("IPYTHON_DIR", None)
os.environ["IPYTHONDIR"] = py3compat.unicode_to_str(ipdir, "utf-8")
try:
app = BaseIPythonApplication()
# The lines below are copied from Application.initialize()
app.init_profile_dir()
app.init_config_files()
app.load_config_file(suppress_errors=False)
finally:
if old_ipdir1:
os.environ["IPYTHONDIR"] = old_ipdir1
if old_ipdir2:
os.environ["IPYTHONDIR"] = old_ipdir2