Skip to main content

用Python玩转北化OJ平台

Project description

BUCTOJ 用Python玩转北化OJ平台

BUCT-OJ 的一些功能封装成包,从而实现通过脚本提交代码等。

⚠ 仅供学习测试,不能用于特殊用途

⚠ 对于拥有管理员账号的同学,应该有自觉使用管理号的觉悟,不会用来免做题目

主要功能

模拟登录

from BUCTOJ import login
cookies = login(用户名, 密码)

使用cookies中的session即可以账号身份进行操作

若账号密码错误,则返回cookie不可用

提交代码

from BUCTOJ import submit
submit(比赛的cid,要提交问题的pid,你的cookie,要提交的代码)

上述方式会使用C++语言进行提交(目前仅支持C++)

进入比赛的某道题目后,地址栏的url中会有cid和pid。

例如 Contest2347A 题,url为 http://182.92.175.181/problem.php?cid=2347&pid=0 ,因此此题目的cid为2374,pid为0

cookie是登录功能所获得的cookie。

自动完成一个比赛

from BUCTOJ import finish1contest
finish1contest(比赛cid, 你的用户名, 你的密码, 管理员用户名, 管理员密码)

前提

  1. 拥有一个管理员账号

  2. 每道题都有用C++通过者

功能

若满足以上两个条件,则此函数具有以下功能:

  1. 每隔大约15s通过一道题

  2. 查重率为0

若某次比赛中一些题目无人用C++通过,则程序会跳过此题继续提交下一题

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

BUCTOJ-0.0.12.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

BUCTOJ-0.0.12-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file BUCTOJ-0.0.12.tar.gz.

File metadata

  • Download URL: BUCTOJ-0.0.12.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.4

File hashes

Hashes for BUCTOJ-0.0.12.tar.gz
Algorithm Hash digest
SHA256 d484d67ff1e7ba8a9c048476d29a6a625642f7383d2a4741fb33f9059b7b0d46
MD5 4497060809b195651471e9d5a2840042
BLAKE2b-256 4034d08cbe7f77667dd141e0d1c72b76f4dd62b986eda1543a24f632344387f9

See more details on using hashes here.

File details

Details for the file BUCTOJ-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: BUCTOJ-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.4

File hashes

Hashes for BUCTOJ-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 25efd1239f3a60887649277e0e5ff4da3a74abb996ee8cd08e75f3730b60b6ea
MD5 f657c28768e8d93362a96f36161131d5
BLAKE2b-256 62941f48c09a3ec0b2c15653bd2539edcb5505eff93b792e21eadcf14491a3e2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page