随笔分类 - 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
阅读全文
摘要:一、Python发送邮件,将文件中的内容读取后放入邮件正文(不带附件) 二、Python发送带附件的邮件
阅读全文
摘要:# -*- coding:utf-8 -*-from email.mime.text import MIMETextfrom email.header import Headerimport smtplib def send_mail(file_new): f = open(file_new,'rb
阅读全文
摘要:一、python读取txt文件:(思路:先打开文件,读取文件,最后用for循环输出内容) fp = open('test.txt','r') lines = fp.readlines() fp.close() for line in lines: username = line.split(',')
阅读全文
摘要:冒泡算法:#-*- coding: UTF-8 -*-#冒泡排序def func(lt):if type(lt).__name__ !='list' and type(lt).__name__ !='tuple':returnif type(lt).__name__ == 'tuple':retur...
阅读全文

浙公网安备 33010602011771号