上一页 1 ··· 9 10 11 12 13
摘要: 这里的运行环境是:python2.7 threading模块中的Timer能够帮助实现定时任务,而且是非阻塞的。每隔60秒执行一次! 再比如: 比如3秒后打印helloworld: from threading import Timerdef printHello(): print "hello w 阅读全文
posted @ 2017-08-09 16:26 AAA五金批发王建军 阅读(421) 评论(0) 推荐(0) 编辑
摘要: 首先要了解,函数是什么?书上可能会说函数是完成功能的模块之类的话。其实说白了,函数就是个你招来的工人。你给他一些材料,告诉他怎么用这些材料拼装,然后他负责把拼装好的成品交给你。材料就是函数的参数,成品是函数的输出,而怎么拼装就是你写的函数体代码了。比如这段代码 def worker(a, b, c) 阅读全文
posted @ 2017-08-08 10:50 AAA五金批发王建军 阅读(483) 评论(0) 推荐(0) 编辑
摘要: if __name__ == '__main__': str1 = input('input a string: \n') str2 = input('input a sub string: \n') ncount = str1.count(str2) print(ncount) 阅读全文
posted @ 2017-08-08 10:28 AAA五金批发王建军 阅读(5251) 评论(0) 推荐(1) 编辑
摘要: #!/usr/bin/python # -*- coding: UTF-8 -*- if __name__ == '__main__': from sys import stdout filename = input('输入文件名:\n') fp = open(filename,"w") ch = input('输入字符串:\n') while ch ... 阅读全文
posted @ 2017-08-08 10:23 AAA五金批发王建军 阅读(5924) 评论(0) 推荐(0) 编辑
摘要: import datetime d1 = datetime.date(2015,10,7) d2 = datetime.date(2015,8,15) print((d1-d2).days) import datetime d1 = datetime.date(2015,10,7) d2 = dat 阅读全文
posted @ 2017-08-07 17:33 AAA五金批发王建军 阅读(2261) 评论(0) 推荐(1) 编辑
摘要: >>> import time >>> print(time.time()) 1501749158.9849465 >>> print(time.localtime()) time.struct_time(tm_year=2017, tm_mon=8, tm_mday=3, tm_hour=16, tm_min=33, tm_sec=22, tm_wday=3, tm_yday=215, tm... 阅读全文
posted @ 2017-08-03 16:39 AAA五金批发王建军 阅读(467) 评论(0) 推荐(0) 编辑
摘要: 题目:打印出所有的"水仙花数",所谓"水仙花数"是指一个三位数,其各位数字立方和等于该数本身。例如:153是一个"水仙花数",因为153=1的三次方+5的三次方+3的三次方。 程序分析:利用for循环控制100-999个数,每个数分解出个位,十位,百位。 程序源代码: for n in range( 阅读全文
posted @ 2017-08-03 16:25 AAA五金批发王建军 阅读(4585) 评论(0) 推荐(0) 编辑
摘要: """将一个列表的数据复制到另一个列表中。""" """ 使用[:] """ a = [1,2,3] b = a[:] print b # 将a的数据赋值给b 当a的数值发生改变时b不变 [1, 2, 3] a = [1,2,3] b = a print b # 将a的地址赋值给b 当a的数值发生改变时b随之改变 [1, 2, 3] a = [1,2,3] b = ... 阅读全文
posted @ 2017-08-03 15:58 AAA五金批发王建军 阅读(271) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/TankXiao/p/4045439.html#guanlian http://www.cnblogs.com/musicmovie/p/4222245.html 阅读全文
posted @ 2017-08-03 13:34 AAA五金批发王建军 阅读(338) 评论(0) 推荐(0) 编辑
摘要: HTTP信息头管理器在Jmeter的使用过程中起着很重要的作用,通常我们在通过Jmeter向服务器发送http请求(get或者post)的时候,往往后端需要一些验证信息,比如说web服务器需要带过去cookie给服务器进行验证,一般就是放在请求头(header)中,因为对于此类请求,在Jmeter中 阅读全文
posted @ 2017-08-03 13:28 AAA五金批发王建军 阅读(3831) 评论(0) 推荐(0) 编辑
摘要: *这样虽然可以实现163邮箱的登录,但是可能会被锁定ip *备注账号文档在上传的文件:163账号_2.rar 阅读全文
posted @ 2017-08-02 16:47 AAA五金批发王建军 阅读(316) 评论(0) 推荐(0) 编辑
摘要: 最近搞到了一批163邮箱的账号和密码,但是里面有部分账号不能用,密码是错的。 以此为背景 人工手动挨个登录检查效率太低! 于是写了下面这个脚本: 这样我就可以知道哪一行的账号密码是错误的了! 但是问题来了,163邮箱对同一ip账号密码输错6次就锁定了。所以我在执行了20多行的时候,后面全部登录失败了 阅读全文
posted @ 2017-08-02 16:32 AAA五金批发王建军 阅读(1866) 评论(0) 推荐(0) 编辑
摘要: 用于生成一个指定范围内的随机符点数,两个参数其中一个是上限,一个是下限。 import random print random.uniform(10, 20) print random.uniform(20, 10) # #18.7356606526 #12.5798298022 random.ra 阅读全文
posted @ 2017-08-02 15:53 AAA五金批发王建军 阅读(305) 评论(0) 推荐(0) 编辑
摘要: #设置密码输入,显示为****** import msvcrt,sys def pwd_input(): chars = [] while True: try: newChar = msvcrt.getch().decode(encoding="utf-8") except: ... 阅读全文
posted @ 2017-08-02 11:08 AAA五金批发王建军 阅读(1874) 评论(0) 推荐(0) 编辑
摘要: import smtplib from email.mime.text import MIMEText from email.header import Header import time #密文输入密码 from getpass import getpass def email(): try: #这两个参数必须要,不然就会出现554的错误,不然少参数 ... 阅读全文
posted @ 2017-08-01 16:29 AAA五金批发王建军 阅读(743) 评论(0) 推荐(0) 编辑
摘要: import smtplib from email.mime.text import MIMEText from email.header import Header import time def email(): #发送邮箱服务器 smtpserver = "smtp.163.com" #发送邮箱的账号/密码 user= "我的邮箱@163.com" ... 阅读全文
posted @ 2017-08-01 10:17 AAA五金批发王建军 阅读(2432) 评论(1) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13