随笔分类 -  Python学习笔记

摘要:#!/usr/bin/env python #coding:utf-8 import MySQLdb import config class MySQLHelper(object): def __init__(self): self.conn=config.conn_dict def get_one 阅读全文
posted @ 2017-07-25 14:42 栗子玄机 阅读(194) 评论(0) 推荐(0)
摘要:一、Python发送邮件,将文件中的内容读取后放入邮件正文(不带附件) 二、Python发送带附件的邮件 阅读全文
posted @ 2017-06-24 16:27 栗子玄机 阅读(149) 评论(0) 推荐(0)
摘要:# -*- coding:utf-8 -*-from email.mime.text import MIMETextfrom email.header import Headerimport smtplib def send_mail(file_new): f = open(file_new,'rb 阅读全文
posted @ 2016-05-11 14:16 栗子玄机 阅读(226) 评论(0) 推荐(0)
摘要:一、python读取txt文件:(思路:先打开文件,读取文件,最后用for循环输出内容) fp = open('test.txt','r') lines = fp.readlines() fp.close() for line in lines: username = line.split(',') 阅读全文
posted @ 2016-05-05 17:51 栗子玄机 阅读(6120) 评论(0) 推荐(1)
摘要:冒泡算法:#-*- coding: UTF-8 -*-#冒泡排序def func(lt):if type(lt).__name__ !='list' and type(lt).__name__ !='tuple':returnif type(lt).__name__ == 'tuple':retur... 阅读全文
posted @ 2015-12-11 17:21 栗子玄机 阅读(284) 评论(0) 推荐(0)