Skip to main content

A library that can operate srun network

Project description

SrunTool

release pypi support-version license commit

深澜校园网操作类,本软件包内容仅在 NCWU 经过测试。

支持

  • 登录
  • 退出
  • 查询当前用户信息
  • 查询当前用户姓名

安装

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple sruntool

使用

from sruntool import SrunOperator, get_explain

if __name__ == '__main__':
    account = '16612345678'  # 账号
    so = SrunOperator('192.168.0.170')  # 创建operator

    r = so.current_info()  # 获取当前登录账号信息
    if r['error'] == 'ok':  # 已登录
        print(r['user_name'], '已经在线')
        exit(0)

    r = so.login(account, '123456')  # 登录
    if r['ecode'] == 0:
        print('登录成功', so.get_name(account))

        # 不延时容易造成请求频繁
        from time import sleep

        sleep(1)

        r = so.logout(account)
        if r['ecode'] == 0:
            print('下线成功')
    else:
        print('登录失败', get_explain(r['ecode']))

更新日志

感谢

深澜认证协议分析,python模拟登录

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

sruntool-0.1.4.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

sruntool-0.1.4-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file sruntool-0.1.4.tar.gz.

File metadata

  • Download URL: sruntool-0.1.4.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for sruntool-0.1.4.tar.gz
Algorithm Hash digest
SHA256 1280aef073400f80bfe28a9884e0269e1f9904d77ed75e17006c03c7cb6967a3
MD5 395b1539d92ce7be301c369dfe9123d8
BLAKE2b-256 7960be78b00789160142edd7fd52f6548fde2d07cc6dd5250e08e83ba12adc94

See more details on using hashes here.

File details

Details for the file sruntool-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: sruntool-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for sruntool-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 425fd33002735040d6b5efe7bbf9c790001f77abf15d694cab1b8861413109fe
MD5 070715aa39d3f443c1d8d7db8c336529
BLAKE2b-256 d3a731b6a91f5edb89892a6ca788c9a6faf7e6d8eaa07d76cfec1a2320da79b3

See more details on using hashes here.

Supported by

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