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

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第三方库


热门话题
如何在JavaSpring引导应用程序中合并两个对象?   java序列化与防止按钮、链接等被点击两次有关吗?   java CORBA序列:我可以用方法定义对象序列吗?   java没有SonarQube的Spring批处理项目的代码覆盖   java如何在eclipse中删除上述方法和属性的搜索引用链接   spring boot如何在java注释中使用泛型T类型?   java导入外部(未编译)groovy类,并将它们保留在jar之外   如何在int[]Java中找到所有值的总和?   Java在ArrayList中删除重复项的问题   Java更改菜单栏、项目背景和文本颜色   网络设置网络。使用Elasticsearch JAVA API将主机发布到客户端节点   Python到Java加密/解密,确保密码匹配?   java Faing在Ubuntu12.04上构建eucalyptus的困难   java使用org。阿帕奇。平民fileupload在mysql数据库中上传图像,但调用servlet会得到一个空白的白页