__init__.py 文件源码

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

项目:gthnk 作者: iandennismiller 项目源码 文件源码
def create_db(db_filename, conf_filename, python_path, manage_path):
    if not os.path.isfile(db_filename):
        print("create:\tdb\t{0}".format(db_filename))
        os.environ["SETTINGS"] = conf_filename
        res = subprocess.check_output([python_path, manage_path, "db", "upgrade"])
        if not res:
            res = "OK"
        print("result:\t{0}".format(res))

        username = input("Choose a username for accessing Gthnk: ")
        password = getpass("Choose a password:")
        res = subprocess.check_output([python_path, manage_path, "user_add",
            "-e", username, "-p", password])
        if not res:
            res = "OK"
        print("result:\t{0}".format(res))
    else:
        print("exists:\t{0}".format(db_filename))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号