python 访问php程序,实现定时
#!/usr/bin/python
#test2.py
import sys
import urllib2
j = True
jj = 1
##########用于统计,所以分页,
url = 'http://localhost/acb/index.php?page=%s' while j:
r = urllib2.urlopen(url %(jj),timeout=40).read()
print 'r=%s' %(r)
####根据返回值,判断是否要继续执行
if r == 'ok':
j = False
print 'complete'
jj = jj+1
print jj
python 访问php程序,实现定时的更多相关文章
- 10.Selenium+Python+任务计划程序实现定时发送邮件
一.python具体代码实现 # coding=utf-8 import smtplib from email.mime.text import MIMEText from email.header ...
- 简明python教程 --C++程序员的视角(一):数值类型、字符串、运算符和控制流
最初的步骤 Python是大小写敏感的 任何在#符号右面的内容都是注释 >>> help('print')在“print”上使用引号,那样Python就可以理解我是希望获取关于“pr ...
- Python访问MySQL(1):初步使用PyMySQL包
Windows 10家庭中文版,MySQL 5.7.20 for Win 64,Python 3.6.4,PyMySQL 0.8.1,2018-05-08 ---- 使用Python访问MySQL数据 ...
- 快速掌握用python写并行程序
目录 一.大数据时代的现状 二.面对挑战的方法 2.1 并行计算 2.2 改用GPU处理计算密集型程序 3.3 分布式计算 三.用python写并行程序 3.1 进程与线程 3.2 全局解释器锁GIL ...
- 快速开始Python/WSGI应用程序
快速开始Python-wsig应用程序 官方参考文档 安装 uwsgi 安装 pip install uwsgi uwsgi --version # 查看 uwsgi 版本 测试 uwsgi 是否正常 ...
- 如何在本地使用scala或python运行Spark程序
如何在本地使用scala或python运行Spark程序 包含两个部分: 本地scala语言编写程序,并编译打包成jar,在本地运行. 本地使用python语言编写程序,直接调用spark的接口, ...
- Python访问Amazon官网异常
使用Python访问亚马逊(Amazon)官网,如果没有将headers更改为浏览器的信息, 有几率会触发:检测到当前可能是自动程序,需要输入验证码: 将header修改成浏览器后,需要等一段时间或者 ...
- 一个python爬虫小程序
起因 深夜忽然想下载一点电子书来扩充一下kindle,就想起来python学得太浅,什么“装饰器”啊.“多线程”啊都没有学到. 想到廖雪峰大神的python教程很经典.很著名.就想找找有木有pdf版的 ...
- 如何禁止DELETE、PUT、OPTIONS、TRACE、HEAD等协议访问应用程序 .
原文:http://linder.iteye.com/blog/735435 简介 WebDAV (Web-based Distributed Authoring and Versioning)是 ...
随机推荐
- Stream消息流 和 Stream Grouping 消息流组
- hdu 1050 Moving Tables
http://acm.hdu.edu.cn/showproblem.php?pid=1050 这个题我首先直接用的常规贪心,用的和那个尽可能看更多完整节目那种思路.但是.......一直WA....T ...
- 解决div和父div不上对齐
加一个vertical-align: top;就好了.原因就是inline-block会使元素向下对齐.这和padding-top,margin-top没有关系的.使用浮动就不会有这种情况了,当然会带 ...
- sudo apt-get install gksu
exmyth@Inspiron-5437:/etc/default$ gksu gedit apport 程序“gksu”尚未安装. 您可以使用以下命令安装:sudo apt-get install ...
- C socket demo
一.服务端-server.c #include <stdio.h> #include <sys/socket.h> #include <arpa/inet.h> # ...
- java 5 Lock
import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; public clas ...
- 征服 Nginx + Tomcat【转】
征服 Nginx + Tomcat Server Architecture/Distributed nginxtomcatsessioncluster 2年前一直折腾Apache,现如今更习惯Ngi ...
- [Canvas] Introduction to drawing with p5js
In this lesson we look at using color and the basic drawing methods of p5js, and how they can be com ...
- [React ] React Fundamentals: Component Lifecycle - Mounting Usage
The previous lesson introduced the React component lifecycle mounting and unmounting. In this lesson ...
- Android中FTP服务器、客户端搭建以及SwiFTP、ftp4j介绍
本文主要内容: 1.FTP服务端部署---- 基于Android中SwiFTP开源软件介绍: 2.FTP客户端部署 --- 基于ftp4j开源jar包的客户端开发 : 3.使用步骤 --- 如何测试我 ...