Python
随风漂流的
分享自己的
展开
-
python遍历目录和文件
1.python遍历指定文件夹内目录和 文件 2.其中path指定自己想要的目录 3.路径前加r是为了转义\\ #!/usr/bin/python3 import ospath = r"F:\\" for root,dirs,files in os.walk(path,topdown=False): for name in files: print(os.path.原创 2017-05-11 16:36:40 · 337 阅读 · 0 评论 -
python邮件发送
1.这里使用代理服务器 #!/usr/bin/python import smtplib from email.mime.text import MIMEText from email.header import Header #第三方SMTP邮件服务 mail_host = 'smtp.***.com' mail_user = '' #用户名 mail_pass = ''#密码 sender原创 2017-06-02 15:06:21 · 253 阅读 · 0 评论 -
Python 发送带附件的邮件
#!/usr/bin/python3 import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.header import Header sender = '[email protected]' receivers = ['42924原创 2017-06-02 15:15:00 · 1156 阅读 · 0 评论