SG-Toolkit
使用科技手段对抗形式主义,提供了一些自动化脚本。能够帮助你完成网上学堂刷课、安全知识考试自动答题,等
怎么用?
安装
pip install SG-Toolkit- 把与浏览器同版本的
chromedriver.exe放置在启动脚本同级目录下
网上学堂刷课
from sg_toolkit.gwxt import FuckGWXT
browser = FuckGWXT(
"账号",
"密码",
"单位名称",
"http://localhost/www/command/CollegeControl?flag=collegeTC&tcID=ef8afbf81de&tab=collTcLesson&type=&worktypeid=&pageNo1=15&pageSize1=10&comewho=null"
)
browser.run()
外网安全知识答题
from sg_toolkit.yh import FuckAnGui
browser = FuckAnGui(
"身份证号",
"密码",
"https://localhost:29703/COMEXAMPLATFORM/login/tologin.do",
"./题库.xlsx"
)
browser.run()
题库格式
| 题干 | 答案 | 选项A | 选项B | 选项C | 选项D |
|---|---|---|---|---|---|
| 你今天吃的什么早点? | A | 豆浆 | 八宝粥 | 胡辣汤 | 肉夹馍 |
| 都有什么早点? | BCD | 豆浆 | 八宝粥 | 胡辣汤 | 肉夹馍 |
| 今天的早点有豆浆 | 正确 |
内网安全知识答题
代码示例
from sg_toolkit.gkpt import FuckAnGui
browser = FuckAnGui(
"账号",
"密码",
"http://localhost/comlogin/routeLogin.html",
"./题库.xlsx"
)
browser.run()
题库格式
| 题型 | 题干 | 选项 | 答案 |
|---|---|---|---|
| 单选题 | 你今天吃的什么早点? | A-豆浆|B-八宝粥|C-胡辣汤|D-肉夹馍 | A |
| 多选题 | 你今天吃的什么早点? | A-豆浆|B-八宝粥|C-胡辣汤|D-肉夹馍 | BCD |
| 判断题 | 今天的早点有豆浆 | A-正确|B-错误 | A |
- 表格必须包含题型、题干、选项、答案四列
- 题型只能包含单选题、多选题、判断题
- 每个选项使用单竖线|分隔,并且按照A-选项类似格式书写。判断题选项内容固定为A-正确|B-错误
- 答案列有且仅有大写字母
注意事项
第一次运行程序必定失败,在弹出的窗口输入用户名、密码、验证码,点击登录,浏览器将自动保存登录信息。下次运行即可自动答题。
环境要求
- Chrome浏览器
- Chrome WebDriver(版本需与浏览器保持一致)
- Python
- Python第三方库(见requirements.txt)
更新日志
| 版本号 | 更新内容 | 更新日期 |
|---|---|---|
| 0.1.0 | 初始化项目 | 2026年7月13日 |
| 0.2.0 | 项目更名为SG-Toolkit | 2026年7月14日 |
| 0.2.1 | 修复安全知识答题截止到99题的BUG | 2026年7月14日 |
| 0.2.2 | 安全知识自动答题完成后显示成绩 | 2026年7月14日 |
| 0.2.3 | In 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.4 | Refactor 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.1 | Unpin 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日 |
| 0.4.0 | 新增外网安全答题脚本, 修复一些BUG | 2026年11月19日 |
Metadata
Release files for SG-Toolkit 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sg_toolkit-0.4.0.tar.gz | 20.7 kB | Without provenance | Details for sg_toolkit-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sg_toolkit-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for sg_toolkit-0.4.0-py3-none-any.whl |
Total release size: 43.9 kB
Release files / sg_toolkit-0.4.0.tar.gz
| Download URL | sg_toolkit-0.4.0.tar.gz |
|---|---|
| Size | 20.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
601a8bea5f7bbc0fc6702a43ccd60716695fa8af6afb852b6cfd2bb6dd46e96c
|
|
BLAKE2b-256 checksum How to use checksums |
0e33930ed0db0109c21c22c9af48763716901a1ec6f2070356569fee45fe53ec
|
| 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.4.0-py3-none-any.whl
| Download URL | sg_toolkit-0.4.0-py3-none-any.whl |
|---|---|
| Size | 23.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c9cd968f15e058577ba3f5561c2ba37fdd6aa78aadb06a119bfaefda1e4a67b6
|
|
BLAKE2b-256 checksum How to use checksums |
2fea019fdd18cc32ba0b06eb8f99995ed5d1b7a575a35369111f7f6598a18ef9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Security for SG-Toolkit 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.