Set up the project

Set up a Python package named ustcwlt, which provides a command-line interface to log in to USTC WLT.

Traditional way to log in to USTC WLT

#!/bin/sh
curl -d "cmd=set&name=${USERNAME}&password=${PASSWORD}&type=${TYPE}&exp=${EXP}" \
  http://wlt.ustc.edu.cn/cgi-bin/ip

Here, ${TYPE} is set to 0 ~ 7, meaning the type of the network exit (http://wlt.ustc.edu.cn/link.html). The recommended value is 0. ${EXP} is the expired time. When it is set to 0, it means no expired time.

Command line interface

The command-line interface should provide the option for username, password, type (by default 0), and exp (by default 0). Also, it should allow setting by the environment variables USTCWLT_* -- if the value has been set by the environment variable, there is no need to set it in the command-line interface.