1 #!/usr/bin/env python
2 #coding=utf8
3 import time,os,sched,urllib,httplib
4 import smtplib
5 import string
6
7 schedule = sched.scheduler(time.time, time.sleep)
8 def perform_command(self, inc):
9 schedule.enter(inc, 0, perform_command, (self, inc))
10 #os.system(cmd)
11 monitoring(self)
12 def timming_exe(self, inc = 60):
13 schedule.enter(inc, 0, perform_command, (self, inc))
14 schedule.run()
15
16 def monitoring(self):
17 print("开始监控...")
18 httpClient = None
19 try:
20 params = urllib.urlencode({'name': 'tom', 'age': 22})
21 headers = {"Content-type": "application/x-www-form-urlencoded"
22 , "Accept": "text/plain"}
23