摘要: Hosts是一个没有扩展名的系统文件,其基本作用就是将一些常用的网址域名与其对应的IP地址建立一个关联“数据库”,当用户在浏览器中输入一个需要登录的网址时,系统会首先自动从Hosts文件中寻找对应的IP地址,一旦找到,系统会立即打开对应网页,如果没有找到,则系统再会将网址提交DNS域名解析服务器进行IP地址的解析,如果发现是被屏蔽的IP或域名,就会禁止打开此网页!1、加快域名解析对于要经常访问的网... 阅读全文
posted @ 2018-10-21 23:11 Osword 阅读(171) 评论(0) 推荐(0) 编辑
摘要: #从网页获取cookie# import http.cookiejar,urllib.request# cookie = http.cookiejar.LWPCookieJar()#创建cookie处理器对象# handler = urllib.request.HTTPCookieProcessor(cookie)#对cookie进行处理# openner = urllib.request.bu... 阅读全文
posted @ 2018-10-21 14:14 Osword 阅读(1120) 评论(0) 推荐(0) 编辑
摘要: #POST请求的数据保存在表单中dict#利用字典dict = {'what':'flag'}可以达到这一要求from urllib import request,parseurl = "http://123.206.87.240:8002/post/"headrs = { 'User-Agent':"Mozilla/4.0 (compatible; MSIE 5.5;Windows NT)... 阅读全文
posted @ 2018-10-20 11:11 Osword 阅读(747) 评论(0) 推荐(0) 编辑
摘要: 1. #2. ?3. &1. # 10年9月,twitter改版。一个显著变化,就是URL加入了"#!"符号。比如,改版前的用户主页网址为http://twitter.com/username改版后,就变成了http://twitter.com/#!/username 这是主流网站第一次将"#"大规模用于重要URL中。这表明井号(Hash)的作用正在被重新认识。本文根据HttpWatch的... 阅读全文
posted @ 2018-10-18 22:26 Osword 阅读(202) 评论(0) 推荐(0) 编辑
摘要: #读取两行 删除'卡号:'和 '卡密:'#保存到数组中 ' ' 隔开然后输出f = open('E:\\test1.txt')done = 0num = []while not done: aLine = f.readline().strip().replace('\n','').replace('卡号:','').replace('卡密:','') num.append(aLine)... 阅读全文
posted @ 2018-10-09 15:33 Osword 阅读(1052) 评论(0) 推荐(0) 编辑
摘要: # 题目:将一个列表的数据复制到另一个列表中list1 = [x for x in range(1,5)]list2 = []print(list1)print(list2) #初始化print('地址赋值------------------')list2 = list1print (list2)print('调用函数-------------------')list3 = []list3 = l... 阅读全文
posted @ 2018-09-26 21:02 Osword 阅读(11435) 评论(0) 推荐(0) 编辑
摘要: # #创建GUI界面的步骤# - 导入tkinter 模块# - 创建 GUI 应用程序的顶层主窗口对象# - 在窗口内创建其他组件# - 将这些GUI 模块与底层代码进行连接,什么部件就用什么部件调用pack()# - 进入主事件循环,响应由用户触发每个时间import tkintertop = tkinter.Tk()labell = tkinter.Label(top,text = 'hel... 阅读全文
posted @ 2018-09-23 16:29 Osword 阅读(1879) 评论(0) 推荐(0) 编辑
摘要: # TCP编程# - 创建socket# - 连接服务器# -发送数据# - 接受数据# - 关闭socket#import sockets = socket.socket(socket.AF_INET,socket.SOCK_STREAM)s.connect(('www.baidu.com',80))s.send(b'GET/HTTP/1.1/r\nHost:www.baidu.com... 阅读全文
posted @ 2018-09-23 16:28 Osword 阅读(214) 评论(0) 推荐(0) 编辑
摘要: class Person: number = 0 def __init__(self,name,gender,age): self.name = name self.gender = gender self.age = age Person.number+=1 def displayPerson(self): ... 阅读全文
posted @ 2018-09-23 16:27 Osword 阅读(293) 评论(0) 推荐(0) 编辑
摘要: import tkinterimport sysimport retop = tkinter.Tk()top.geometry('400x170+350+150')top.wm_title('综合实例')def validateText(): val = entry1.get() if re.findall('^[0-9a-zA-Z_]{1,}$',str(val)): ... 阅读全文
posted @ 2018-09-23 16:27 Osword 阅读(3022) 评论(0) 推荐(0) 编辑