摘要:
#代理 proxies={ "http":"http://121.61.24.112:9999", "https":"https://125.120.8.172:6666", } headers={ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) ... 阅读全文
摘要:
运行结果 阅读全文
摘要:
#post userinfo={'username':'jack','password':'123456'} r=requests.post('http://httpbin.org/post',data=userinfo) print(r.text) 输出结果 "C:\Program Files\A 阅读全文
摘要:
网址http://httpbin.org/get的内容如下 代码输出的结果: 增加了cookies的信息 阅读全文
摘要:
#下载图片 imgUrl='http://www.pptbz.com/pptpic/UploadFiles_6909/201211/2012111719294197.jpg' r=requests.get(imgUrl,stream=True)#注意True要用大写,要加stream=True流 with open('tree.jpg','wb') as file: file.write... 阅读全文
摘要:
输出结果为: 阅读全文
摘要:
在此项目的文件夹中创建data.json文件 内容如下 最后的输出结果为: 阅读全文
摘要:
斐波那契数列即著名的兔子数列:1、1、2、3、5、8、13、21、34、…… 数列特点:该数列从第三项开始,每个数的值为其前两个数之和,用python实现起来很简单: 这里 a, b = b, a+b 右边的表达式会在赋值变动之前执行,即先执行右边,比如第一次循环得到b-->1,a+b --> 0+ 阅读全文
摘要:
# 约瑟夫环 def f(peo,number,start): li=[str(i) for i in range(peo) ] # start=0 # number=3 c=0 while len(li)>2: c+=1 start+=(number-1) start%=len(li) n=li.pop(... 阅读全文
摘要:
注意:字典本身没有顺序 阅读全文