main.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:rqalpha-mod-optimization 作者: xingetouzi 项目源码 文件源码
def create_profile(path, name):
    profile_name = get_conda_env()
    prefix = sys.exec_prefix
    cmd = "%s profile create --parallel --profile=%s --ipython-dir=%s" % \
          (os.path.join(prefix, BIN_DIR[platform.system()], "ipython"), profile_name, path)
    print(cmd)
    status = os.system(cmd)
    if status:
        return status
    shutil.copy(os.path.join(os.path.dirname(os.path.abspath(__file__)), "ipcluster_config.py"),
                os.path.join(path, "profile_%s" % profile_name, "ipcluster_config.py"))
    config = {
        "environment": {
            "CONDA_DEFAULT_ENV": profile_name
        }
    }
    with codecs.open(os.path.join(path, "profile_%s" % profile_name, "config.json"), "w", encoding="utf-8") as f:
        json.dump(config, f)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号