Экспорт:
Папки
/root/polzovateli/var_null/yaziki-programmirovaniya/python/Url/urllib
Не экспортировать закрытые директории
Преобразовывать заметки в html
Экспортировать
Применить |
| 2015-03-12 14:51:42 |
import sys from datetime import datetime import urllib import json proxies = {} url = "http://site/test/test.php" count = 0 this_time = "" step_sec = 5 global_step = 0 test_step = 2 test = 0 def my_while(): global this_time, count, step_sec time_k = str(datetime.strftime(datetime.now(), "%H:%M:%S")) if(this_time != time_k): this_time = time_k count = count + 1 if(count == step_sec): count = 0 go() def go(): global global_step, proxies, url global_step = global_step + 1 print("connect...") u = urllib.urlopen(url, proxies=proxies) result = u.read() print(result) while(1 == 1): if(test == 1 and global_step > test_step): exit() my_while()
| 2014-08-05 15:56:46 |
import urllib import json proxies = {} url = "http://bbb" u = urllib.urlopen(url, proxies=proxies) json_mas = json.loads(u.read())