#coding:utf-8 import requests,bs4,sys #防止 编码问题 reload(sys) sys.setdefaultencoding('utf8') for i in range(1,30000):     res = requests.get('http://www.yangtuobaobei.cn/?'+str(i))     userFile = open('userNew.txt', 'a')     if(res.status_code == 200):   ...

阅读全文>>

错误描述: /opt/ActivePython-2.7/lib/python2.7/site-packages/bs4/__init__.py:166: UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). This usually isn't a problem, but if you run this code on another system, or in a different virtua...

阅读全文>>

#coding:utf8 import requests,re,sys #防止 编码问题 reload(sys) sys.setdefaultencoding('utf8') for i in range(1,400000): res = requests.get('http://www.yangtuobaobei.cn/?'+str(i)) if res.status_code==200: userFile = open('user.txt','a') #多行匹配,拿到用户名 user = re....

阅读全文>>

#coding:utf8 import zipfile,os def backupToZip(folder):     folder = os.path.abspath(folder)     number = 1     while True:         zipFileName = os.path.basename(folder)+"_"+str(number)+".zip"         if not os.path.exis...

阅读全文>>

#coding:utf8 import os for muluName,zimuluName,fileName in os.walk("H:\\LK"):     for zimulu in zimuluName:         print "目录:"+muluName+" 中的子目录:"+zimulu     for file in fileName:         print "目录:"+muluName+" 中的文件 :"+file print...

阅读全文>>

保存密码到 password中, 输入对应的参数 ,可以直接拿到密码 #coding:utf-8 passwords = { 'email':'asdasxxasdfadasdf', 'blog':'azzxcvzcvzaaa', 'baidu':'zcvasdfadfaf', 'youku':'azcaaszxcvzcvzv' } import sys if(len(sys.argv)<2): print "参数个数不得少于2个".decode("utf-8").encode("GBK") sys....

阅读全文>>

#coding:utf8 people={"baidu":{"apple":10,"orange":20}, "sohu":{"banner":5,"apple":13}, "youku":{"orange":3,"cup":4}, "qq":{"pies":3,"apple":90} } def getNumber(website,item): numBrought=0 for k,v in website.items(): numBrought = numBrought...

阅读全文>>