当前位置: 首页>>代码示例>>Python>>正文


Python BaseIPythonApplication.init_config_files方法代码示例

本文整理汇总了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)
开发者ID:123jefferson,项目名称:MiniBloq-Sparki,代码行数:17,代码来源:test_application.py

示例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
开发者ID:123jefferson,项目名称:MiniBloq-Sparki,代码行数:24,代码来源:test_application.py


注:本文中的IPython.core.application.BaseIPythonApplication.init_config_files方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。