Skip to main content

SG-Toolkit

使用科技手段对抗形式主义,提供了一些自动化脚本。能够帮助你完成网上学堂刷课、安全知识考试自动答题,等

怎么用?

网上学堂刷课

browser = FuckGWXT(
    "san.zhang",
    "1q2w!Q@W",
    "美国能源",
    "http://localhost/www/command/CollegeControl?flag=collegeTC&tcID=ef8afbf81de&tab=collTcLesson&type=&worktypeid=&pageNo1=15&pageSize1=10&comewho=null"
)
browser.run()

安全知识答题

代码示例

browser = FuckAnGui(
    "san.zhang",
    "1qaz@WSX",
    "http://localhost/comlogin/routeLogin.html",
    "./题库.xlsx"
)
browser.run()

题库格式

题型题干选项答案
单选题你今天吃的什么早点?A-豆浆|B-八宝粥|C-胡辣汤|D-肉夹馍A
多选题你今天吃的什么早点?A-豆浆|B-八宝粥|C-胡辣汤|D-肉夹馍BCD
判断题今天的早点有豆浆A-正确|B-错误A
  1. 表格必须包含题型、题干、选项、答案四列
  2. 题型只能包含单选题、多选题、判断题
  3. 每个选项使用单竖线|分隔,并且按照A-选项类似格式书写。判断题选项内容固定为A-正确|B-错误
  4. 答案列有且仅有大写字母

注意事项

第一次运行程序必定失败,在弹出的窗口输入用户名、密码、验证码,点击登录,浏览器将自动保存登录信息。下次运行即可自动答题。

环境要求

  • Chrome浏览器
  • Chrome WebDriver(版本需与浏览器保持一致)
  • Python
  • Python第三方库(见requirements.txt)

更新日志

版本号更新内容更新日期
0.1.0初始化项目2026年7月13日
0.2.0项目更名为SG-Toolkit2026年7月14日
0.2.1修复安全知识答题截止到99题的BUG2026年7月14日
0.2.2安全知识自动答题完成后显示成绩2026年7月14日
0.2.3In sg_toolkit.gkpt.FuckAnGui change Chrome user-data-dir to use current working directory (os.getcwd()) for per-user cache. Replace fragile regex-based bg-size check in exam() with a deterministic counter loop (i from 0 to 99) and increment it each iteration to avoid potential infinite loops while keeping existing submit behavior.2026年7月14日
0.2.4Refactor sg_toolkit.gkpt: remove unused re import, add tqdm, replace fragile while/regex loop with a deterministic tqdm(range(100)) loop, make exam() return the page body text and have process() return that result. Update sg_toolkit.gwxt: add module docstring/encoding and make process() return the result of learn().2026年7月14日
0.3.0添加注释; 安全知识自动答题工具新增题目数量参数; 启动方法改为browser.run()2026年7月14日
0.3.1Unpin requirements (requirements.txt), bump package version to 0.3.1 (sg_toolkit/__init__.py). Improve gkpt.py robustness by reading Excel as strings, normalizing whitespace in题型/题干/选项/答案, stripping UI text, replacing prints with logging, trimming option text before matching, and adding explicit ValueError cases for unsupported question types and invalid judge answers. These changes reduce brittle string-matching and improve error visibility.2026年7月15日
0.3.2填充题库缺失值为空字符串2026年7月21日

Release files for SG-Toolkit 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for SG-Toolkit 0.3.2
File Size Uploaded
sg_toolkit-0.3.2.tar.gz 19.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for SG-Toolkit 0.3.2
File Interpreter ABI Platform
sg_toolkit-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 40.5 kB

Release files / sg_toolkit-0.3.2.tar.gz

Download URL sg_toolkit-0.3.2.tar.gz
Size 19.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2517ab9735d20caa15e1c19e99f7cf3ebc6ba17daff6a131dd81a08b3c910a88
BLAKE2b-256 checksum
How to use checksums
776ff7be84388cc52474d2fe6418fb6560a0f4a0bbf22adac8b73ba881993a70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / sg_toolkit-0.3.2-py3-none-any.whl

Download URL sg_toolkit-0.3.2-py3-none-any.whl
Size 20.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d84d2d2ab43d2e3f4177d4e61f3904cc7181737cf039821d844cfe6e2a5ece35
BLAKE2b-256 checksum
How to use checksums
d862a3ca41297f7d064b6cac88c3dc1f52b200c3036dede1bf3cef495951187d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page