# -*- coding:utf-8 -*-
import time
import get
url = "http://.........."
# url_test = "http://.................."
def send_request(url, deviceType, action):
try:
response = get.post(
url=url + "/push...." + deviceType + "/" + action + "/0/150650/0/0",
)
print('Response HTTP Status Code: {status_code}'.format(
status_code=response.status_code))
print('Response HTTP Response Body: {content}'.format(
content=response.content))
except Exception,e:
print('HTTP Request failed',e)
if __name__ == '__main__':
action_10_array = ['18','19','20','100','101','5','6','14','24','25','32','34','2','3']
action_1_array = ['10','12','2','1']
action_11_array = ['10']
action_2_array = ['2', '1', '10', '6','5']
action_7_array = ['5', '6', '14', '10','7','1']
action_doorbell_array = ['handmove', 'doorbell', 'lowPower', 'offline','dismantle']
action_SmokeAlarm_array = ['1','3']
# action_10_array = ['100','101','2','3']
for i in range(0,len(action_doorbell_array)):
action = action_doorbell_array[i]
deviceType = 'doorbell'
#以上参数要改
print action
send_request(url, deviceType, action)
time.sleep(1)
# send_request(url_test, deviceType, action)
xx = raw_input() #按下输出
Python参数拼接
最新推荐文章于 2024-04-29 17:43:05 发布