cli直接从终端查看、编码和提交问题
termicoder的Python项目详细描述
术语编辑器
从终端直接查看、编码、提交
用:heart:byDivesh Uttamchandani
一种基于python的命令行界面,用于帮助进行竞争性编程。termicoder的目标是自动化和简化编码、测试和向在线评委提交解决方案的过程,以便人们只关注算法
termicoder背后的灵感
安装
用户安装
pip install termicoder
如果需要,使用sudo-h。最好使用pip3(python3)
开发者安装
- 克隆此回购协议
- 在这个repo的根文件夹中运行
pip install --editable .
注意上面命令末尾的点(。)
注意:最好使用virtualenv和pip3(python3)
- 若要删除此包,请在repo的根文件夹中运行
python setup.py develop --uninstall
note:termicoder正处于开发阶段,只在ubuntu+python3上进行了测试。对其他配置的支持正在进行中,如果您正在使用其他平台并遇到错误,请为它们创建一个issue。对于windows,也可以尝试使用Bash on Ubuntu on Windows;大多数功能都已经过测试,并按预期工作。
自动完成bash
要设置termicoder命令的选项卡自动完成功能,
见termicoder config autocomplete --help
当前支持
评委包括
包括语言支持
- C
- Python2/3
亮点
Usage: termicoder [OPTIONS] COMMAND [ARGS]...
__ __ _ __
\ \ / /____ _________ ___ (_)________ ____/ /__ _____
\ \ / __/ _ \/ ___/ __ `__ \/ / ___/ __ \/ __ / _ \/ ___/
/ / / /_/ __/ / / / / / / / / /__/ /_/ / /_/ / __/ /
/_/ \__/\___/_/ /_/ /_/ /_/_/\___/\____/\__,_/\___/_/
view, code & submit problems directly from terminal.
Options:
--version Show the version and exit.
-v, --verbosity LVL Either CRITICAL, ERROR, WARNING, INFO or DEBUG
-h, --help Show this message and exit.
Commands:
clip Copies code from file to clipboard.
code Creates and opens file with template code.
config Configure settings, autocomplete etc.
debug Launches custom debug interface.
list List the contents of current folder.
repl Start an interactive shell.
setup Sets up problem, contests and login.
submit Submit a solution.
test Test code against the sample testcases.
view View contests and problems.
详细的命令帮助
有关特定命令的详细信息,请使用:
termicoder --help termicoder <COMMAND> --help
或者您可以查看helptext,它包含所有帮助命令的输出
样本运行
对于示例,我们建议通过sample run 其中包含详细信息
更改日志
changelog和旧版本可在Releases下使用。
对termicoder的贡献
termicoder主要是用python编写的。 如果您希望为代码库做出贡献,则应首先阅读以下内容:
您也可以通过
改进文档。
- 大多数文档位于documentation文件夹中。若要启动fork this repo,请更改并创建拉取请求
报告错误或请求功能。
- 请创建一个关于bug/功能的issue。
对工作给予反馈。(赞扬和批评都同样受到赞赏)。
许可证
注
这是对termicoder的完全重新设计和重写,以支持法官作为插件, 以及支持新的codechef api。
与previous implementation不同的是
完全不需要exec
和eval
调用。实现Judges
,
Problems
和Contests
作为类而不是模块。
有一个抽象类Judge
,用于将操作分派给
通过Judge Factory
判断特定实例。
开发人员可以子类化并在外部实现Judge
类
并将其模块附加到安装工具入口点-termicoder.judge_plugins
。
termicoder动态加载这些判断并分派操作。
编写judge插件的完整文档和
Termicoder很快就会上市。到那时你可以看看
termicoder/judges/codechef
在这个repo中作为一个示例实现。
有关如何订阅入口点的示例,请参见setup.py
termicoder.judge_plugins
。
此发行版当前包括使用 codechef api用于codechef api hackathon powered by Alibaba
在这个版本中还实现了许多全新的特性,包括
termicoder repl
,termicoder config
,termicoder clip
,termicoder config autocomplete
虽然这个实现缺乏对颜色的支持,但是 以前实现中出现的功能。 这主要是由于哈克顿的时间限制。codechef接口 严格限制每次请求,这会减慢开发速度。 一旦我们测试并完善了 基于api的特性。
完善后,此回购代码将替换main termicoder repo
您可以通过在pip
安装。
以前的实现有版本号~0.2.*
,而当前的实现有
版本~0.3.*
一旦所有的主要功能都实现了,我们将转移到beta版本~0.9.*
用于开发分支,转移到稳定版本~1.0.*
用于主分支