#!/usr/bin/env python3 import requests import sys #http://utf8.api.smschinese.cn/?Uid=USERNAME&Key=KEY&smsMob=NUMBERS&smsText=MESSAGE def sendsms(USERNAME, KEY, NUMBERS, MESSAGE): url="http://utf8.api.smschinese.cn/" data = { "Uid" : USERNAME, "Key" : KEY, "smsMob" : NUMBERS, "smsText" : MESSAGE } requests.post(url,params=data) if __name__ == "__main__": USERNAME = "gaoyuanzhi" KEY = "d41d8cd98f00b204e980" NUMBERS = sys.argv[1] MESSAGE = sys.argv[2] sendsms(USERNAME, KEY, NUMBERS, MESSAGE)