python

扫描FTP弱口令或破解用户

#!usr/bin/envpython #!coding=utf-8 """ 目录下需要host.txt,user.txt,pwd.txt三个文件。 """ __author__='zhengjim' fromftplibimportFTP importftplib fromthreadingimportThread...

刘德胜 2019-09-15 221次浏览

入队出队

#-*-coding:UTF-8-*- fromcollectionsimportdeque queue=deque(["Eric","John","Michael"]) queue.append("Terry")#Terry入队 queue.append("Graham")#Graham入队 queue.poplef...

刘德胜 2019-09-15 213次浏览

去重交集集合运算

#-*-coding:UTF-8-*- #basket={'apple','orange','apple','pear','orange','banana'} #print(basket)#这里演示的是去重功能 #{'orange','banana','pear','apple'} #s='liu'inbasket#快...

刘德胜 2019-09-15 184次浏览

爬虫

#-*-coding:UTF-8-*- importre importurllib.request importurllib fromcollectionsimportdeque queue=deque() visited=set() url='http://www.baobao-shop.com'#入口页面,可...

刘德胜 2019-09-12 176次浏览

获取单个网页的内容

#-*-coding:UTF-8-*- #获取单个网页的内容 importurllib.request url="http://www.baobao-shop.com" data=urllib.request.urlopen(url).read() data=data.decode('UTF-8') print(dat...

刘德胜 2019-09-12 168次浏览

发送邮件

importsmtplib fromemail.mime.textimportMIMEText defsendMail(user,pwd,to,subject,text): msg=MIMEText(text) msg['From']=user msg['To']=to msg['Subject']=subject ...

刘德胜 2019-09-12 159次浏览