赵斌

赵斌的博客

他的个人主页  他的博客

POJ 自动提交脚本

赵斌  2009年08月15日 星期六 01:14 | 1653次浏览 | 0条评论

原文通过blogbus2zeuux工具同步发布:http://antmanler.blogbus.com/logs/44125799.html

文章发布时间:2009/8/13/14/23

今天晚上闲来无事,写了一个POJ自动提交的脚本.
功能

  1. 根据文件类型和名称自动判断题目ID和选择默认编译器
  2. 自动登录提交
  3. 等待并获取题目执行结果,输出错误信息
  4. 快速查看指定题目内容
  5. to be continued

下载

压缩后的字节码: pojas.0.1.tar.gz
源代码: pojas.0.1.src.tar.gz

安装运行

需要 BeautifulSoup 的支持,可到其 官方主页 下载最新版
解压,改权限,拷贝到系统环境变量能搜到到目录:

~$ tar -xvvzf pojas.0.1tar.gz
~$ chmod +x pojas.py
~$ ln -s pojas.py ~/bin

命令行选项

可以使用 --help 命令查看, 输出如下:

Usage: pojas [options]

Options:
  -h, --help            show this help message and exit
  -f FILE_NAME, --file=FILE_NAME
                        specify the source to submit
  -v VIEW, --view=VIEW  specify the compiler for the source code
  -p PID, --problem=PID
                        specify the prblem id
  -l LANG, --lang=LANG  specify the compiler for the source code
  -u UID, --user=UID    user name on POJ

例子:

  1. 提交名为3425.cpp的文件 : pojas.py 3425.cpp -u antmanler, 提示输入密码,之后输出如下
  2. 提交名为3690v2.c的文件,使用完整命令行: pojas.py -f 3690v2.c -l gcc -p 3690 -u antmanler
    程序回返回出错信息

    这是编译错误时返回的信息
  3. 显示题目信息, 可以使用 pojas.py 3690 或者是 pojas.py -v 3690

 

 

评论

我的评论:

发表评论

请 登录 后发表评论。还没有在Zeuux哲思注册吗?现在 注册 !

暂时没有评论

Zeuux © 2024

京ICP备05028076号