从任何竞争性编程网站下载并测试样本测试用例

ACedIt的Python项目详细描述


一个命令行工具,用于针对示例测试用例运行代码不离开终端:)

支持的站点

  • 共作用力
  • codechef
  • spoj
  • 哈克朗
  • 自动编码器

支持的语言

  • C类
  • C++
  • Python
  • Java
  • 红宝石
  • 哈斯克尔

安装

从源构建

  • git clone https://github.com/coderick14/ACedIt
  • cd ACedIt
  • python setup.py install

作为一个python包

pip install --user ACedIt

用法

usage: acedit [-h] [-s {codeforces,codechef,hackerrank,spoj}] [-c CONTEST]
          [-p PROBLEM] [-f] [--run SOURCE_FILE]
          [--set-default-site {codeforces,codechef,hackerrank,spoj}]
          [--set-default-contest DEFAULT_CONTEST]

optional arguments:
  -h, --help            show this help message and exit
  -s {codeforces,codechef,hackerrank,spoj}, --site {codeforces,codechef,hackerrank,spoj}
                        The competitive programming platform, e.g. codeforces,
                        codechef etc
  -c CONTEST, --contest CONTEST
                        The name of the contest, e.g. JUNE17, LTIME49, COOK83
                        etc
  -p PROBLEM, --problem PROBLEM
                        The problem code, e.g. OAK, PRMQ etc
  -f, --force           Force download the test cases, even if they are cached
  --run SOURCE_FILE     Name of source file to be run
  --set-default-site {codeforces,codechef,hackerrank,spoj}
                        Name of default site to be used when -s flag is not
                        specified
  --set-default-contest DEFAULT_CONTEST
                        Name of default contest to be used when -c flag is not
                        specified
  --clear-cache         Clear cached test cases for a given site. Takes
                        default site if -s flag is omitted

在安装过程中,默认站点设置为codeforces。你 可以随时使用上述标志进行更改。

示例

  • 获取单个问题的测试用例

    acedit -s codechef -c AUG17 -p CHEFFA
    
  • 获取竞赛中所有问题的测试用例

    acedit -s codechef -c AUG17
    
  • 强制下载测试用例,即使它们已被缓存

    acedit -s codeforces -c 86 -p D -f
    
  • 测试代码(当设置了默认站点和默认竞赛并且文件名与问题代码相同时)

    acedit --run D.cpp
    
    acedit --run CHEFFA.py
    

    由于文件名与问题代码相同,因此不需要-p标志。

  • 测试代码(显式指定竞赛和问题代码)

    acedit --run solve.cpp -c 835 -p D
    
    acedit --run test.py -s codechef -c AUG17 -p CHEFFA
    

注:

  • 以前版本中提到的工作目录结构不再需要和支持
  • Spoj可能会有一些问题,因为它们对于不同的问题有不同的DOM树请随意对此作出贡献或者其他你能想到的:)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java将字符串拆分为带关键字的部分   删除数据库后未指定java数据源问题“url”属性   网络化java多人游戏连接   Java当新字符串等于旧字符串时,为什么substring()不创建新对象?   一个实例到多个bean的java注入   JavaSpringMVC验证错误消息   java总结if语句,并从另一个对象(如字符串[])读取if条件(动态if)   需要多个输入的Java IF语句   jsf如何选择正确的bean范围?   java将数据库值加载到组合框JSP,Hibernate   一次活动中的java 3布局   团队和球员反对Java的困难   java ActionListener如何知道按下了哪个按钮?